Quiz

Select the best answer for each question. After completing the quiz, check your answers using the answer key in the appendix.
  1. Which of the following creates an index on the column EmpID for the table Sasuser.Staffmaster?
    1. proc sql;
         create simple index(empid) 
            on sasuser.staffmaster;
    2. proc sql;
         create empid index 
            on sasuser.staffmaster(empid);
    3. proc sql;
         create simple index 
            on empid from sasuser.staffmaster;
    4. proc sql;
         create index empid 
            on sasuser.staffmaster(empid);
  2. 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?
    1. KEY
    2. UNIQUE
    3. NODUPS
    4. NODUPKEY
  3. 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.)
    1. proc sql;
         create index destination 
            on sasuser.flightdelays(flightnumber,
                                    destination);
    2. proc sql;
         create composite index places 
            on sasuser.flightdelays (flightnumber,
                                     destination);
    3. proc sql;
         create index on flightnumber,destination 
            from sasuser.flightdelays (places);
    4. proc sql;
         create index places 
            on sasuser.flightdelays (flightnumber,
                                     destination);
  4. Which of the following writes a message to the SAS log that shows whether PROC SQL has used an index?
    1. options msglevel=i;
      proc sql;
         select * 
            from sasuser.internationalflights
            where date between '01mar2000'd 
                  and '07mar2000'd;
    2. options index=yes;
      proc sql;
         select * 
            from sasuser.internationalflights
            where date between '01mar2000'd 
                  and '07mar2000'd;
    3. proc sql;
         select * (idxwhere=yes)
            from sasuser.internationalflights
            where date between '01mar2000'd 
                  and '07mar2000'd;
    4. proc sql;
         select * (msglevel=i)
            from sasuser.internationalflights
            where date between '01mar2000'd 
                  and '07mar2000'd;
  5. Which of the following drops (deletes) an index from a table?
    1. proc sql;
         drop composite index flights 
            from sasuser.marchflights;
    2. proc sql;
         delete index flights 
            on sasuser.staffmaster(flightnumber, date);
    3. proc sql;
         drop index flights 
            from sasuser.marchflights;
    4. proc sql;
         delete index 
            on sasuser.marchflights(flightnumber,
                                    flightdate);
  6. Which of the following statements shows you all the indexes that are defined for a table?
    1. DESCRIBE INDEX
    2. DESCRIBE TABLE
    3. SELECT
    4. IDXNAME
  7. What is the purpose of specifying the data set option IDXWHERE=YES?
    1. It forces SAS to use the best available index to process the WHERE expression.
    2. It creates an index from the expression in the WHERE clause.
    3. It writes messages about index usage to the SAS log.
    4. It stops SAS from using any index.
  8. Which of the following is false regarding the use of an index?
    1. Equijoins can be performed without internal sorts.
    2. Indexes provide fast access to a small subset of data.
    3. Indexes can be created for numeric columns only.
    4. Indexes can enforce uniqueness.
  9. Using an index is not likely to optimize a PROC SQL query in which of the following situations?
    1. The query contains an IN subquery that references the key column.
    2. 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.
    3. The query is an equijoin, and all the columns in the join expression are indexed in one of the tables being joined.
    4. The key column is specified only in a SELECT clause.
  10. Which of the following is false regarding the IDXNAME= data set option?
    1. The specified index must exist.
    2. The specified index must be suitable by having at least its first or only column match a condition in the WHERE expression.
    3. The option enables you to create and name an index on the table.
    4. The option directs SAS to use an index that you specify.
..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
3.145.50.222