Chapter 4: Combining Tables Vertically Using Proc SQL

Reviewed by Editorial Team
The ProProfs editorial team is comprised of experienced subject matter experts. They've collectively created over 10,000 quizzes and lessons, serving over 100 million users. Our team includes in-house content moderators and subject matter experts, as well as a global network of rigorously trained contributors. All adhere to our comprehensive editorial guidelines, ensuring the delivery of high-quality content.
Learn about Our Editorial Process
| By Moxleyv
M
Moxleyv
Community Contributor
Quizzes Created: 38 | Total Attempts: 21,992
| Attempts: 183 | Questions: 10
Please wait...
Question 1 / 10
0 %
0/100
Score 0/100
1. Which PROC SQL step will return the names of all the students who took both the PROG1 and PROG2 classes?

Explanation

The set operator INTERSECT returns all rows that are common to both tables. Specifying the keyword ALL suppresses PROC SQL's additional pass through the data to eliminate duplicate rows.

Submit
Please wait...
About This Quiz
Chapter 4: Combining Tables Vertically Using Proc SQL - Quiz

Explore the intricacies of combining tables vertically in PROC SQL with this focused quiz. Topics include UNION, EXCEPT, INTERSECT operations, and understanding column overlay in SQL queries. Essential... see morefor learners aiming to master advanced SQL techniques. see less

2. 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?

Explanation

The set operator EXCEPT returns all the rows in the first table that do not appear in the second table. The keyword ALL suppresses the extra pass that PROC SQL makes through the data to eliminate duplicate rows. The EXCEPT operator when used alone will also produce the output specified in the question.

Submit
3. Which PROC SQL step combines the tables Summer and Winter to produce the output displayed below?

Explanation

The output shown above contains all rows that are unique in the combined set of rows from both tables, and the columns have been overlaid by position. This output is generated by a set operation that uses the set operator UNION without keywords.

Submit
4. The keyword ALL cannot be used with which of the following set operators?

Explanation

By default, when processing a set operation that contains the EXCEPT, INTERSECT, and UNION set operators, PROC SQL makes an extra pass through the data to eliminate duplicate rows. The keyword ALL is used to suppress that additional pass through the tables, allowing duplicate rows to appear in the result set. Because the OUTER UNION set operator displays all rows, the keyword ALL is invalid and cannot be used with OUTER UNION.

Submit
5. Which PROC SQL step generates the following output from the tables Dogs and Pets?

Explanation

This PROC SQL output includes all rows from the table Pets that do not appear in the table Dogs. No duplicates are displayed. A PROC SQL set operation that contains the set operator EXCEPT without keywords produces these results.

Submit
6. Which statement is false regarding the keyword CORRESPONDING?

Explanation

The keyword CORRESPONDING (CORR) can be used alone or together with the keyword ALL.

Submit
7. Which PROC SQL step combines tables but does not overlay any columns?

Explanation

The PROC SQL set operation that uses the set operator OUTER UNION without a keyword is the only code shown that does not overlay any columns in output.

Submit
8. Which statement is false with respect to a set operation that uses the EXCEPT, UNION, or INTERSECT set operator without a keyword?

Explanation

In set operations that use the operator EXCEPT, INTERSECT, or UNION, and no keyword, columns are overlaid based on their position in the SELECT clause. It does not matter whether the overlaid columns have the same name. When columns are overlaid, the column name is taken from the first table that is specified in the SELECT clause.

Submit
9. Which PROC SQL step will return the names of all the students who took PROG1, PROG2, or both classes?

Explanation

The set operator UNION returns all rows that are unique in the combined set of rows from both tables.

Submit
10. Which PROC SQL step will generate the same results as the following DATA step?

Explanation

The DATA step returns all rows from the first table along with all rows from the second table, maintaining the order specified in the BY statement. Same-named columns are overlaid by default. The set operator OUTER UNION returns all rows from both tables. The CORR keyword causes same-named columns to be overlaid. The ORDER BY clause causes the result rows to be ordered by values of the specified column (LName).

Submit
View My Results

Quiz Review Timeline (Updated): Mar 22, 2023 +

Our quizzes are rigorously reviewed, monitored and continuously updated by our expert board to maintain accuracy, relevance, and timeliness.

  • Current Version
  • Mar 22, 2023
    Quiz Edited by
    ProProfs Editorial Team
  • Mar 08, 2013
    Quiz Created by
    Moxleyv
Cancel
  • All
    All (10)
  • Unanswered
    Unanswered ()
  • Answered
    Answered ()
Which PROC SQL step will return the names of all the students who took...
The PROG1 and PROG2 tables list students who took...
Which PROC SQL step combines the...
The keyword ALL cannot be used with which of the following...
Which PROC SQL step generates the following output from the...
Which statement is false regarding the keyword CORRESPONDING?
Which PROC SQL step combines tables but does not overlay any...
Which statement is false with respect to a set operation...
Which PROC SQL step will return the names of all the students who took...
Which PROC SQL step will generate the same results as the following...
Alert!

Advertisement