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 Certadv.Summer and Certadv.Winter to produce the
output displayed below?
-
proc sql;
select *
from certadv.summer intersect all
select *
from certadv.winter;
quit;
-
proc sql;
select *
from certadv.summer outer union
select *
from certadv.winter;
quit;
-
proc sql;
select *
from certadv.summer union corr
select *
from certadv.winter;
quit;
-
proc sql;
select *
from certadv.summer union
select *
from certadv.winter;
quit;
-
Which PROC SQL step
combines tables but does not overlay any columns?
-
proc sql;
select *
from groupa outer union
select *
from groupb;
quit;
-
proc sql;
select *
from groupa as a outer union corr
select *
from groupb as b;
quit;
-
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;
quit;
-
proc sql;
select *
from groupa as a intersect
select *
from groupb as b;
quit;
-
Which statement is false
regarding the keyword CORR (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 that are
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 Certadv.Dogs and Certadv.Pets?
-
proc sql;
select name, price
from certadv.pets except all
select *
from certadv.dogs;
quit;
-
proc sql;
select name, price
from certadv.pets except
select *
from certadv.dogs;
quit;
-
proc sql;
select name, price
from certadv.pets except corr all
select *
from certadv.dogs;
quit;
-
proc sql;
select *
from certadv.dogs except corr
select name, price
from certadv.pets;
quit;
-
The PROG1 and PROG2
tables list students who took the PROG1 and PROG2 courses, respectively.
Which PROC SQL step will give you the names of the students who took
only the PROG1 class?
-
proc sql;
select fname, lname
from certadv.prog1 intersect
select fname, lname
from certadv.prog2;
quit;
-
proc sql;
select fname, lname
from certadv.prog1 except all
select fname, lname
from certadv.prog2;
quit;
-
proc sql;
select *
from certadv.prog2 intersect corr
select *
from certadv.prog1;
quit;
-
proc sql;
select *
from certadv.prog2 union
select *
from certadv.prog1;
quit;
-
Which PROC SQL step
returns the names of all the students who took PROG1, PROG2, or both
classes?
-
proc sql;
select fname, lname
from certadv.prog1 intersect
select fname, lname
from certadv.prog2;
quit;
-
proc sql;
select fname, lname
from certadv.prog1 outer union corr
select fname, lname
from certadv.prog2;
quit;
-
proc sql;
select fname, lname
from certadv.prog1 union
select fname, lname
from certadv.prog2;
quit;
-
proc sql;
select fname, lname
from certadv.prog1 except corr
select fname, lname
from certadv.prog2;
quit;
-
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 certadv.prog1 union
select fname, lname
from certadv.prog2;
quit;
-
proc sql;
select fname, lname
from certadv.prog1 except corr
select fname, lname
from certadv.prog2;
quit;
-
proc sql;
select fname, lname
from certadv.prog1 intersect all
select fname, lname
from certadv.prog2;
quit;
-
proc sql;
select fname, lname
from certadv.prog1 union corr
select fname, lname
from certadv.prog2;
quit;