D**0 发帖数: 195 | 1 总是被这类的题弄晕。请大侠解释一下下面这些题。能解释几道都可以。多谢!
Item 6 of 63 Mark item for review
The table WORK.PILOTS contains the following data:
WORK.PILOTS
Id Name Jobcode Salary
--- ------ ------- ------
001 Albert PT1 50000
002 Brenda PT1 70000
003 Carl PT1 60000
004 Donna PT2 80000
005 Edward PT2 90000
006 Flora PT3 100000
The data set was summarized to include average
salary based on jobcode:
Jobcode Salary Avg
------- ------ -----
PT1 50000 60000
PT1 70000 60000
PT1 60000 60000
PT2 80000 85000
PT2 90000 85000
PT3 100000 100000
Which SQL statement could NOT generate
this result?
A.
select
Jobcode,
Salary,
avg(Salary) label='Avg'
from WORK.PILOTS
group by Jobcode
order by Id
;
B.
select
Jobcode,
Salary,
(select avg(Salary)
from WORK.PILOTS as P1
where P1.Jobcode=P2.Jobcode) as Avg
from WORK.PILOTS as P2
order by Id
;
C.
select
Jobcode,
Salary,
(select avg(Salary)
from WORK.PILOTS
group by Jobcode) as Avg
from WORK.PILOTS
order by Id
;
D.
select
Jobcode,
Salary,
Avg
from
WORK.PILOTS,
(select
Jobcode as Jc,
avg(Salary) as Avg
from WORK.PILOTS
group by 1)
where Jobcode=Jc
order by Id
;
============
Item 11 of 63 Mark item for review
The following SAS code is submitted:
data WORK.TEMP WORK.ERRORS / view=WORK.TEMP;
infile RAWDATA;
input Xa Xb Xc;
if Xa=. then output WORK.ERRORS;
else output WORK.TEMP;
run;
Which of the following is true of
the WORK.ERRORS data set?
A.
The data set is created when the
DATA step is submitted.
B.
The data set is created when the view
TEMP is used in another SAS step.
C.
The data set is not created because the DATA
statement contains a syntax error.
D.
The descriptor portion of WORK.ERRORS is created
when the DATA step is submitted.
=========
Item 26 of 63 Mark item for review
Given the following SAS data sets:
WORK.VISIT1 WORK.VISIT2
Id Expense Id Cost
--- ------- --- ----
001 500 001 300
001 400 002 600
003 350
The following result set was summarized and
consolidated using the SQL procedure:
Id Cost
--- ----
001 300
001 900
002 600
003 350
Which of the following SQL statements was
most likely used to generate this result?
A.
select
Id,
sum(Expense) label='COST'
from WORK.VISIT1
group by 1
union all
select
Id,
sum(Cost)
from WORK.VISIT2
group by 1
order by 1,2
;
B.
select
id,
sum(expense) as COST
from
WORK.VISIT1(rename=(Expense=Cost)),
WORK.VISIT2
where VISIT1.Id=VISIT2.Id
group by Id
order by
Id,
Cost
;
C.
select
VISIT1.Id,
sum(Cost) as Cost
from
WORK.VISIT1(rename=(Expense=Cost)),
WORK.VISIT2
where VISIT1.Id=VISIT2.Id
group by Id
order by
Id,
Cost
;
D.
select
Id,
sum(Expense) as Cost
from WORK.VISIT1
group by Id
outer union corr
select
Id,
sum(Cost)
from WORK.VISIT2
group by Id
order by 1,2
;
=======
Item 27 of 63 Mark item for review
Given the SAS data sets:
WORK.FIRST WORK.SECOND
Common X Common Y
------ -- ------ --
A 10 A 1
A 13 A 3
A 14 B 4
B 9 B 2
The following SAS program is submitted:
data WORK.COMBINE;
set WORK.FIRST;
set WORK.SECOND;
run;
What data values are stored in data
set WORK.COMBINE?
A.
Common X Y
------ -- --
A 10 1
A 13 3
B 14 4
B 9 2
B.
Common X Y
------ -- --
A 10 1
A 13 3
A 14 3
B 9 4
B 9 2
C.
Common X Y
------ -- --
A 10 1
A 13 3
A 14 .
B 9 4
B . 2
D.
Common X Y
------ -- --
A 10 1
A 13 1
A 14 1
A 10 3
A 13 3
A 14 3
B 9 4
B 9 2
=========
Item 31 of 63 Mark item for review
Given the SAS data sets:
WORK.ONE WORK.TWO
X Y SumY
-- -- ----
A 10 36
A 3
A 14
B 9
The following SAS DATA step is submitted:
data WORK.COMBINE;
if _n_=1 then set WORK.TWO;
set WORK.ONE;
run;
What data values are stored in data set WORK.COMBINE?
A.
An ERROR message is written to the SAS log and
the data set WORK.COMBINE is not created.
B.
SumY X Y |
|