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
creates an index on the column EmpID for the table Sasuser.Staffmaster?
-
proc sql;
create simple index(empid)
on sasuser.staffmaster;
-
proc sql;
create empid index
on sasuser.staffmaster(empid);
-
proc sql;
create simple index
on empid from sasuser.staffmaster;
-
proc sql;
create index empid
on sasuser.staffmaster(empid);
-
Which keyword must you
add to your index definition in the CREATE INDEX statement to ensure
that no duplicate values of the key column can exist?
-
Which of the following
creates a composite index for the table Sasuser.Flightdelays? (Sasuser.Flightdelays
contains the following columns: Date, FlightNumber, Origin, Destination,
DelayCategory, DestinationType, DayOfWeek, and Delay.)
-
proc sql;
create index destination
on sasuser.flightdelays(flightnumber,
destination);
-
proc sql;
create composite index places
on sasuser.flightdelays (flightnumber,
destination);
-
proc sql;
create index on flightnumber,destination
from sasuser.flightdelays (places);
-
proc sql;
create index places
on sasuser.flightdelays (flightnumber,
destination);
-
Which of the following
writes a message to the SAS log that shows whether PROC SQL has used
an index?
-
options msglevel=i;
proc sql;
select *
from sasuser.internationalflights
where date between '01mar2000'd
and '07mar2000'd;
-
options index=yes;
proc sql;
select *
from sasuser.internationalflights
where date between '01mar2000'd
and '07mar2000'd;
-
proc sql;
select * (idxwhere=yes)
from sasuser.internationalflights
where date between '01mar2000'd
and '07mar2000'd;
-
proc sql;
select * (msglevel=i)
from sasuser.internationalflights
where date between '01mar2000'd
and '07mar2000'd;
-
Which of the following
drops (deletes)
an index from a table?
-
proc sql;
drop composite index flights
from sasuser.marchflights;
-
proc sql;
delete index flights
on sasuser.staffmaster(flightnumber, date);
-
proc sql;
drop index flights
from sasuser.marchflights;
-
proc sql;
delete index
on sasuser.marchflights(flightnumber,
flightdate);
-
Which of the following
statements shows you all the indexes that are defined for a table?
-
What is the purpose
of specifying the data set option IDXWHERE=YES?
-
It forces SAS to use
the best available index to process the WHERE expression.
-
It creates an index
from the expression in the WHERE clause.
-
It writes messages about
index usage to the SAS log.
-
It stops SAS from using
any index.
-
Which of the following
is false regarding the use of an index?
-
Equijoins can be performed
without internal sorts.
-
Indexes provide fast
access to a small subset of data.
-
Indexes can be created
for numeric columns only.
-
Indexes can enforce
uniqueness.
-
Using an index is not
likely to optimize a PROC SQL query in which of the following situations?
-
The query contains an
IN subquery that references the key column.
-
The key column is specified
in a WHERE clause expression that contains a comparison operator,
the TRIM or SUBSTR function, the CONTAINS operator, or the LIKE operator.
-
The query is an equijoin,
and all the columns in the join expression are indexed in one of the
tables being joined.
-
The key column is specified
only in a SELECT clause.
-
Which of the following
is false regarding the IDXNAME= data set option?
-
The specified index
must exist.
-
The specified index
must be suitable by having at least its first or only column match
a condition in the WHERE expression.
-
The option enables you
to create and name an index on the table.
-
The option directs SAS
to use an index that you specify.