Select the best answer
for each question. After completing the quiz, check your answers using
the answer key in the appendix.
-
Which of the clauses
in the PROC SQL program below is written incorrectly?
proc sql;
select style sqfeet bedrooms
from choice.houses
where sqfeet ge 800;
-
How many statements
does the program below contain?
proc sql;
select grapes,oranges,
grapes + oranges as sumsales
from sales.produce
order by sumsales;
-
-
Which of the clauses
below correctly sorts rows by the values of the columns Price and
SqFeet?
-
Which clause below specifies
that the two tables Produce and Hardware be queried? Both tables are
located in a library to which the libref Sales has been assigned.
-
select sales.produce sales.hardware
-
from sales.produce sales.hardware
-
from sales.produce,sales.hardware
-
where sales.produce, sales.hardware
-
Complete the SELECT
clause below to create a new column named Profit by subtracting the
values of the column Cost from those of the column Price.
select fruit,cost,price,
________________
-
What happens if you
use a GROUP BY clause in a PROC SQL step without a summary function?
-
The step does not execute.
-
The first numeric column
is summed by default.
-
The GROUP BY clause
is changed to an ORDER BY clause.
-
The step executes but
does not group or sort data.
-
If you specify a CREATE
TABLE statement in your PROC SQL step,
-
the results of the query
are displayed, and a new table is created.
-
a new table is created,
but it does not contain any summarization that was specified in the
PROC SQL step.
-
a new table is created,
but no report is displayed.
-
results are grouped
by the value of the summarized column.
-
Which statement is true
regarding the use of the PROC SQL step to query data that is stored
in two or more tables?
-
When you join multiple
tables, the tables must contain a common column.
-
You must specify the
table from which you want each column to be read.
-
The tables that are
being joined must be from the same type of data source.
-
If two tables that are
being joined contain a same-named column, then you must specify the
table from which you want the column to be read.
-
Which clause in the
following program is incorrect?
proc sql;
select sex,mean(weight) as avgweight
from company.employees company.health
where employees.id=health.id
group by sex;