Chapter 3: Combining Tables Horizontally Using PROC SQL
Correct answer: a
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.
Correct answer: b
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.
Correct answer: d
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.
Correct answer: d
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.
Correct answer: a
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.
Correct answer: c
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.
Correct answer: a
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.
Correct answer: c
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.
Correct answer: c
A maximum of 256 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 256.
Correct answer: d
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.