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 PROC SQL steps creates a new table by copying only the column structure (but not the rows) of an existing table?
    1. proc sql;
         create table work.newpayroll as 
            select *
               from sasuser.payrollmaster;
    2. proc sql;
         create table work.newpayroll 
            like sasuser.payrollmaster;
    3. proc sql;
         create table work.newpayroll 
            copy sasuser.payrollmaster;
    4. proc sql;
         create table work.newpayroll 
            describe sasuser.payrollmaster;
  2. Which of the following PROC SQL steps creates a table that contains rows for the level-1 flight attendants only?
    1. proc sql;
         create table work.newpayroll as
            select *
               from sasuser.payrollmaster
               where jobcode='FA1';
    2. proc sql;
         create work.newpayroll as
            select *
               from sasuser.payrollmaster
               where jobcode='FA1';
    3. proc sql;
         create table work.newpayroll
            copy sasuser.payrollmaster
               where jobcode='FA1';
    4. proc sql;
         create table work.newpayroll as
                sasuser.payrollmaster
            where jobcode='FA1';
  3. Which of the following statements is true regarding the UNDO_POLICY=REQUIRED option?
    1. It must be used with the REQUIRED integrity constraint.
    2. It ignores the specified integrity constraints if any of the rows that you want to insert or update do not meet the constraint criteria.
    3. 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.
    4. 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.
  4. Which of the following is not a type of integrity constraint?
    1. CHECK
    2. NULL
    3. UNIQUE
    4. PRIMARY KEY
  5. Which of the following PROC SQL steps deletes rows for all frequent-flyer program members who traveled less than 10,000 miles?
    1. proc sql;
         delete rows
            from work.frequentflyers
            where milestraveled < 10000;
    2. proc sql;
         drop rows
            from work.frequentflyers
            where milestraveled < 10000;
    3. proc sql;
         drop table
            from work.frequentflyers
            where milestraveled < 10000;
    4. proc sql;
         delete
            from work.frequentflyers
            where milestraveled < 10000;
  6. 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?
    1. proc sql;
         update work.frequentflyers
         set pointsearned=pointsearned*
            case if milestraveled < 10000
                    then 1.5
                 if milestraveled >= 10000
                    then 2
                 else 1
            end;
    2. proc sql;
         update work.frequentflyers
         set pointsearned=pointsearned*
            case when milestraveled < 10000
                      then 1.5
                 when milestraveled >= 10000
                      then 2
                 else 1
            end;
    3. 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;
    4. 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;
  7. Which of the following statements is used to add new rows to a table?
    1. INSERT
    2. LOAD
    3. VALUES
    4. CREATE TABLE
  8. Which of the following statements regarding the ALTER TABLE statement is false?
    1. It enables you to update column attributes.
    2. It enables you to add new columns in your table.
    3. It enables you to drop columns in your table.
    4. It enables you to change a character column to a numeric column.
  9. Which of the following displays the structure of a table in the SAS log?
    1. proc sql;
         describe as
            select *
               from sasuser.payrollmaster;
    2. proc sql;
         describe contents sasuser.payrollmaster;
    3. proc sql;
         describe table sasuser.payrollmaster;
    4. proc sql;
         describe * from sasuser.payrollmaster;
  10. Which of the following creates an empty table that contains the two columns FullName and Age?
    1. proc sql;
         create table work.names
                (FullName char(25), Age num);
    2. proc sql;
         create table work.names as
                (FullName char(25), Age num);
    3. proc sql;
         create work.names
                (FullName char(25), Age num);
    4. proc sql;
         create table work.names
            set (FullName char(25), Age num);
..................Content has been hidden....................

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