Chapter 3. Combining Tables Horizontally Using Proc SQL

  • ISO/IEC 9075
  • ANSI 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: 159 | Questions: 10
Please wait...
Question 1 / 10
0 %
0/100
Score 0/100
1. Given the PROC SQL query and tables shown below, which output is generated?

Explanation

This PROC SQL query is a right outer join, which retrieves all rows that match across tables, based on the join conditions in the ON clause, plus nonmatching rows from the right (second) table.

Submit
Please wait...
About This Quiz
Chapter 3. Combining Tables Horizontally Using Proc SQL - Quiz

This quiz focuses on combining tables horizontally using PROC SQL, specifically through join operations. It tests understanding of Cartesian products, inner joins, and join conditions, enhancing skills in SQL query formulation and execution.

2.
We’ll put your name on your report, certificate, and leaderboard.
2. Which output will the following PROC SQL query generate?

Explanation

This PROC SQL query is a left outer join, which retrieves all rows that match across tables (based on the join conditions in the ON clause), plus nonmatching rows from the left (first) table. No columns are overlaid, so all columns from both tables are displayed.

Submit
3. A Cartesian product is returned when

Explanation

A Cartesian product is returned when join conditions are not specified in a PROC SQL join. In a Cartesian product, each row from the first table is combined with every row from the second table.

Submit
4. Given the PROC SQL query and tables shown below, which output is generated?

Explanation

This PROC SQL query is an inner join. It combines the rows from the first table that match rows from the second table, based on the matching criteria specified in the WHERE clause. Columns are not overlaid, so all columns from the referenced tables (including any columns with duplicate names) are displayed. Any unmatched rows from either table are not displayed.

Submit
5. In order for PROC SQL to perform an inner join,

Explanation

Inner joins combine the rows from the first table that match rows from the second table, based on one or more join conditions in the WHERE clause. The columns being matched must have the same data type, but they are not required to have the same name. For joins, the tables being joined can have different numbers of columns, and the rows do not need to be sorted.

Submit
6. Which statement about the use of table aliases is false?

Explanation

The use of summary functions does not require the use of table aliases. All of the other statements about table aliases that are shown here are true.

Submit
7. Which PROC SQL query produces the same output as the query shown here?
proc sql;
    select a.*,
            duration
        from groupa as a,
            groupb as b
        where a.obs=b.obs;

NOTE   Assume that the table Groupa contains the columns Obs and Med. Groupb contains the columns Obs and Duration. Δ

Explanation

There are two valid formats for writing a PROC SQL inner join. The PROC SQL query shown at the top of this question uses the first inner join format, which does not use a keyword to indicate the type of join. The alternate format is similar to an outer join and uses the keyword INNER JOIN.

Submit
8. Which PROC SQL query will generate the same output as the DATA step match-merge and PRINT step shown below?

Explanation

In order to generate the same output as the DATA step and PRINT steps, the PROC SQL full outer join must use the COALESCE function with the duplicate columns specified as arguments.

Submit
9. A PROC SQL inner join can combine

Explanation

A maximum of 32 tables can be combined in a single inner join. If the join involves views (either in-line views or PROC SQL views), it is the number of tables that underlie the views, not the number of views, that counts towards the limit of 32.

Submit
10. Which statement about in-line views is false?

Explanation

Unlike a table, an in-line view exists only during query execution. Because it is temporary, an in-line view can be referenced only in the query in which it is defined.

Submit
View My Results

Quiz Review Timeline (Updated): Aug 23, 2024 +

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

  • Current Version
  • Aug 23, 2024
    Quiz Edited by
    ProProfs Editorial Team
  • Mar 08, 2013
    Quiz Created by
    Moxleyv
Cancel
  • All
    All (10)
  • Unanswered
    Unanswered ()
  • Answered
    Answered ()
Given the PROC SQL query and tables shown below, which output is...
Which output will the following PROC SQL query generate?
A Cartesian product is returned when
Given the PROC SQL query and tables shown below, which output is...
In order for PROC SQL to perform an inner join,
Which statement about the use of table aliases is false?
Which PROC SQL query produces the same output as the query shown here?...
Which PROC SQL query will generate the same output as the...
A PROC SQL inner join can combine
Which statement about in-line views is false?
Alert!

Advertisement