Quiz

Select the best answer for each question. After completing the quiz, check your answers using the answer key in the appendix.
  1. When is a Cartesian product returned?
    1. When join conditions are not specified in a PROC SQL join.
    2. When join conditions are not specified in a PROC SQL set operation.
    3. When more than two tables are specified in a PROC SQL join.
    4. When the keyword ALL is used with the OUTER UNION operator.
  2. Given the PROC SQL query and tables shown below, which output is generated?
    Table Store1 and Store2
    proc sql;
       select *
          from certadv.store1, certadv.store2
          where store1.wk=store2.wk;
    quit;
    1. PROC SQL Query Output, Answer A
    2. PROC SQL Query Output, Answer B
    3. PROC SQL Query Output, Answer C
    4. PROC SQL Query Output, Answer D
  3. Which output will the following PROC SQL query generate?
    proc sql; 
       select *
          from table1 left join table2
             on table1.g3=table2.g3;
    quit;
    Table 1 and Table 2
    1. PROC SQL Query Output, Answer A
    2. PROC SQL Query Output, Answer B
    3. PROC SQL Query Output, Answer C
    4. PROC SQL Query Output, Answer D
  4. What is needed in order for PROC SQL to perform an inner join?
    1. The tables being joined must contain the same number of columns.
    2. The tables must be sorted before they are joined.
    3. The columns that are specified in a join condition in the WHERE clause must have the same data type.
    4. The columns that are specified in a join condition in the WHERE clause must have the same name.
  5. Which PROC SQL query will generate the same output as the DATA step match-merge and PROC PRINT step shown below?
    data merged;
       merge certadv.table1 certadv.table2;
          by g3;
    run;
    proc print data=merged noobs;
       title 'Merged';
    run;
    Merged Table Output
    1. proc sql;
      title 'Merged';
         select a.g3, z, r
            from table1 as a full join table2 as b
               on a.g3 = b.g3
            order by 1;
      quit;
    2. proc sql;
      title 'Merged';
         select a.g3, z, r
            from table1 as a table2 as b
               on a.g3 = b.g3
            order by 1;
      quit;
    3. proc sql;
      title 'Merged';
         select coalesce(a.g3, b.g3)
                label='G3', z, r
            from table1 as a full join table2 as b
               on a.g3 = b.g3
            order by 1;
      quit;
    4. proc sql;
      title 'Merged';
         select g3, z, r
            from table1 as a full join table2 as b
               on a.g3 = b.g3
            order by 1;
      quit;
  6. Which statement about the use of table aliases is false?
    1. Table aliases must be used when referencing identical table names from different libraries.
    2. Table aliases can be referenced by using the keyword AS.
    3. Table aliases or full table names must be used when referencing a column name that is the same in two or more tables.
    4. Table aliases must be used when using summary functions.
  7. Which statement is true regarding the use of the PROC SQL step to query data that is stored in two or more tables?
    1. When you join multiple tables, the tables must contain a common column.
    2. You must specify the table from which you want each column to be read.
    3. The tables that are being joined must come from the same type of data source.
    4. If two tables that are being joined contain a same-named column, you must specify the table from which you want the column to be read.
Last updated: October 16, 2019
..................Content has been hidden....................

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