Quiz

Select the best answer for each question. After completing the quiz, check your answers using the answer key in the appendix.
  1. Which statement is false with respect to a set operation that uses the EXCEPT, UNION, or INTERSECT set operator without a keyword?
    1. Column names in the result set are determined by the first table.
    2. To be overlaid, columns must be of the same data type.
    3. To be overlaid, columns must have the same name.
    4. By default, only unique rows are displayed in the result set.
  2. The keyword ALL cannot be used with which of the following set operators?
    1. EXCEPT
    2. INTERSECT
    3. UNION
    4. OUTER UNION
  3. Which PROC SQL step combines the tables Certadv.Summer and Certadv.Winter to produce the output displayed below?
    Question 3 Output
    1. proc sql;
         select *
            from certadv.summer intersect all
         select *
            from certadv.winter;
      quit;
    2. proc sql;
         select *
            from certadv.summer outer union
         select *
            from certadv.winter;
      quit;
    3. proc sql;
         select *
            from certadv.summer union corr
         select *
            from certadv.winter;
      quit;
    4. proc sql;
         select *
            from certadv.summer union
         select *
            from certadv.winter;
      quit;
  4. Which PROC SQL step combines tables but does not overlay any columns?
    1. proc sql;
         select *
            from groupa outer union
         select *
            from groupb;
      quit;
    2. proc sql;
         select *
            from groupa as a outer union corr
         select *
            from groupb as b;
      quit;
    3. proc sql;
         select coalesce(a.obs, b.obs)
                label='Obs', med, duration
            from groupa as a full join groupb as b
               on a.obs=b.obs;
      quit;
    4. proc sql;
         select *
            from groupa as a intersect
         select *
            from groupb as b;
      quit;
  5. Which statement is false regarding the keyword CORR (CORRESPONDING)?
    1. It cannot be used with the keyword ALL.
    2. It overlays columns by name, not by position.
    3. When used in EXCEPT, INTERSECT, and UNION set operations, it removes any columns that are not found in both tables.
    4. When used in OUTER UNION set operations, it causes same-named columns to be overlaid.
  6. Which PROC SQL step generates the following output from the tables Certadv.Dogs and Certadv.Pets?
    Quiz Output
    1. proc sql;
         select name, price
            from certadv.pets except all
         select *
            from certadv.dogs;
      quit;
    2. proc sql;
         select name, price
            from certadv.pets except
         select *
            from certadv.dogs;
      quit;
    3. proc sql;
         select name, price
            from certadv.pets except corr all
         select *
            from certadv.dogs;
      quit;
    4. proc sql;
         select *
            from certadv.dogs except corr
         select name, price
            from certadv.pets;
      quit;
  7. The PROG1 and PROG2 tables list students who took the PROG1 and PROG2 courses, respectively. Which PROC SQL step will give you the names of the students who took only the PROG1 class?
    Quiz Output
    1. proc sql;
         select fname, lname
            from certadv.prog1 intersect
         select fname, lname
            from certadv.prog2;
      quit;
    2. proc sql;
         select fname, lname
            from certadv.prog1 except all
         select fname, lname
            from certadv.prog2;
      quit;
    3. proc sql;
         select *
            from certadv.prog2 intersect corr
         select *
            from certadv.prog1;
      quit;
    4. proc sql;
         select *
            from certadv.prog2 union
         select *
            from certadv.prog1;
      quit;
  8. Which PROC SQL step returns the names of all the students who took PROG1, PROG2, or both classes?
    Quiz Output
    1. proc sql;
         select fname, lname
            from certadv.prog1 intersect
         select fname, lname
            from certadv.prog2;
      quit;
    2. proc sql;
         select fname, lname
            from certadv.prog1 outer union corr
         select fname, lname
            from certadv.prog2;
      quit;
    3. proc sql;
         select fname, lname
            from certadv.prog1 union
         select fname, lname
            from certadv.prog2;
      quit;
    4. proc sql;
         select fname, lname
            from certadv.prog1 except corr
         select fname, lname
            from certadv.prog2;
      quit;
  9. Which PROC SQL step returns the names of all the students who took both the PROG1 and PROG2 classes?
    Quiz Output
    1. proc sql;
         select fname, lname
            from certadv.prog1 union
         select fname, lname
            from certadv.prog2;
      quit;
    2. proc sql;
         select fname, lname
            from certadv.prog1 except corr
         select fname, lname
            from certadv.prog2;
      quit;
    3. proc sql;
         select fname, lname
            from certadv.prog1 intersect all
         select fname, lname
            from certadv.prog2;
      quit;
    4. proc sql;
         select fname, lname
            from certadv.prog1 union corr
         select fname, lname
            from certadv.prog2;
      quit;
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