Select the best answer
for each question. After completing the quiz, check your answers using
the answer key in the appendix.
-
Which of the following
PROC SQL steps creates a new table by copying only the column structure
(but not the rows) of an existing table?
-
proc sql;
create table work.newpayroll as
select *
from sasuser.payrollmaster;
-
proc sql;
create table work.newpayroll
like sasuser.payrollmaster;
-
proc sql;
create table work.newpayroll
copy sasuser.payrollmaster;
-
proc sql;
create table work.newpayroll
describe sasuser.payrollmaster;
-
Which of the following
PROC SQL steps creates a table that contains rows for the level-1
flight attendants only?
-
proc sql;
create table work.newpayroll as
select *
from sasuser.payrollmaster
where jobcode='FA1';
-
proc sql;
create work.newpayroll as
select *
from sasuser.payrollmaster
where jobcode='FA1';
-
proc sql;
create table work.newpayroll
copy sasuser.payrollmaster
where jobcode='FA1';
-
proc sql;
create table work.newpayroll as
sasuser.payrollmaster
where jobcode='FA1';
-
Which of the following
statements is true regarding the UNDO_POLICY=REQUIRED option?
-
It must be used with
the REQUIRED integrity constraint.
-
It ignores the specified
integrity constraints if any of the rows that you want to insert or
update do not meet the constraint criteria.
-
It restores your table
to its original state if any of the rows that you try to insert or
update do not meet the specified integrity constraint criteria.
-
It allows rows that
meet the specified integrity constraint criteria to be inserted or
updated, but rejects rows that do not meet the integrity constraint
criteria.
-
Which of the following
is not a type of integrity constraint?
-
Which of the following
PROC SQL steps deletes rows for all frequent-flyer program members
who traveled less than 10,000 miles?
-
proc sql;
delete rows
from work.frequentflyers
where milestraveled < 10000;
-
proc sql;
drop rows
from work.frequentflyers
where milestraveled < 10000;
-
proc sql;
drop table
from work.frequentflyers
where milestraveled < 10000;
-
proc sql;
delete
from work.frequentflyers
where milestraveled < 10000;
-
Which of the following
PROC SQL steps gives bonuses (in points) to frequent-flyer program
members as follows:
-
a 50% bonus for members who traveled
less than 10,000 miles
-
a 100% bonus for members who traveled
10,000 miles or more?
-
proc sql;
update work.frequentflyers
set pointsearned=pointsearned*
case if milestraveled < 10000
then 1.5
if milestraveled >= 10000
then 2
else 1
end;
-
proc sql;
update work.frequentflyers
set pointsearned=pointsearned*
case when milestraveled < 10000
then 1.5
when milestraveled >= 10000
then 2
else 1
end;
-
proc sql;
update work.frequentflyers
set pointsearned=pointsearned*
case if milestraveled < 10000
then pointsearned*1.5
if milestraveled >= 10000
then pointsearned*2
else 1
end;
-
proc sql;
update work.frequentflyers
set pointsearned=pointsearned*
case if milestraveled < 10000
then pointsearned*1.5
if milestraveled >= 10000
then pointsearned*2
else pointsearned*1
end;
-
Which of the following
statements is used to add new rows to a table?
-
Which of the following
statements regarding the ALTER TABLE statement is false?
-
It enables you to update
column attributes.
-
It enables you to add
new columns in your table.
-
It enables you to drop
columns in your table.
-
It enables you to change
a character column to a numeric column.
-
Which of the following
displays the structure of a table in the SAS log?
-
proc sql;
describe as
select *
from sasuser.payrollmaster;
-
proc sql;
describe contents sasuser.payrollmaster;
-
proc sql;
describe table sasuser.payrollmaster;
-
proc sql;
describe * from sasuser.payrollmaster;
-
Which of the following
creates an empty table that contains the two columns FullName and
Age?
-
proc sql;
create table work.names
(FullName char(25), Age num);
-
proc sql;
create table work.names as
(FullName char(25), Age num);
-
proc sql;
create work.names
(FullName char(25), Age num);
-
proc sql;
create table work.names
set (FullName char(25), Age num);