Select the best answer
for each question. After completing the quiz, check your answers using
the answer key in the appendix.
-
Which statement is false
with respect to a set operation that uses the EXCEPT, UNION, or INTERSECT
set operator without a keyword?
-
Column names in the
result set are determined by the first table.
-
To be overlaid, columns
must be of the same data type.
-
To be overlaid, columns
must have the same name.
-
By default, only unique
rows are displayed in the result set.
-
The keyword ALL cannot
be used with which of the following set operators?
-
Which PROC SQL step
combines the tables Summer and Winter to produce the output displayed
below?
-
proc sql;
select *
from summer
intersect all
select *
from winter;
-
proc sql;
select *
from summer
outer union
select *
from winter;
-
proc sql;
select *
from summer
union corr
select *
from winter;
-
proc sql;
select *
from summer
union
select *
from winter;
-
Which PROC SQL step
combines tables but does not overlay any columns?
-
proc sql;
select *
from groupa
outer union
select *
from groupb;
-
proc sql;
select *
from groupa as a
outer union corr
select *
from groupb as b;
-
proc sql;
select coalesce(a.obs, b.obs)
label='Obs', med, duration
from groupa as a
full join
groupb as b
on a.obs=b.obs;
-
proc sql;
select *
from groupa as a
intersect
select *
from groupb as b;
-
Which statement is false
regarding the keyword CORRESPONDING?
-
It cannot be used with
the keyword ALL.
-
It overlays columns
by name, not by position.
-
When used in EXCEPT,
INTERSECT, and UNION set operations, it removes any columns not found
in both tables.
-
When used in OUTER UNION
set operations, it causes same-named columns to be overlaid.
-
Which PROC SQL step
generates the following output from the tables Dogs and Pets?
-
proc sql;
select name, price
from pets
except all
select *
from dogs;
-
proc sql;
select name, price
from pets
except
select *
from dogs;
-
proc sql;
select name, price
from pets
except corr all
select *
from dogs;
-
proc sql;
select *
from dogs
except corr
select name, price
from pets;
-
The PROG1 and PROG2
tables list students who took the PROG1 and PROG2 courses, respectively.
Which PROC SQL step gives you the names of the students who took only
the PROG1 class?
-
proc sql;
select fname, lname
from prog1
intersect
select fname, lname
from prog2;
-
proc sql;
select fname, lname
from prog1
except all
select fname, lname
from prog2;
-
proc sql;
select *
from prog2
intersect corr
select *
from prog1;
-
proc sql;
select *
from prog2
union
select *
from prog1;
-
Which PROC SQL step
returns the names of all the students who took PROG1, PROG2, or both
classes?
-
proc sql;
select fname, lname
from prog1
intersect
select fname, lname
from prog2;
-
proc sql;
select fname, lname
from prog1
outer union corr
select fname, lname
from prog2;
-
proc sql;
select fname, lname
from prog1
union
select fname, lname
from prog2;
-
proc sql;
select fname, lname
from prog1
except corr
select fname, lname
from prog2;
-
Which PROC SQL step
returns the names of all the students who took both the PROG1 and
PROG2 classes?
-
proc sql;
select fname, lname
from prog1
union
select fname, lname
from prog2;
-
proc sql;
select fname, lname
from prog1
except corr
select fname, lname
from prog2;
-
proc sql;
select fname, lname
from prog1
intersect all
select fname, lname
from prog2;
-
proc sql;
select fname, lname
from prog1
union corr
select fname, lname
from prog2;
-
Which PROC SQL step
generates the same results as the following DATA step?
data allstudents;
set prog1 prog2;
by lname;
run;
proc print noobs;
run;
|
|
-
proc sql;
select fname, lname
from prog1
outer union corr
select fname, lname
from prog2
order by lname;
-
proc sql;
select fname, lname
from prog1
union
select fname, lname
from prog2
order by lname;
-
proc sql;
select fname, lname
from prog2
outer union
select fname, lname
from prog1
order by lname;
-
proc sql;
select fname, lname
from prog2
union corr
select fname, lname
from prog1
order by lname;