True or false: A correlated subquery references a table in the SELECT clause.
Answer: False, the correlated subquery references a column in the main query.
Which set operator will not remove duplicate rows from the result of a compound query?
Answer: UNION ALL will not remove duplicate rows from the result of a compound query.
What characteristics of the columns in a compound query using INTERSECT must match?
Answer: The number of columns and their datatypes must match in a compound query using INTERSECT. The lengths of the columns and the names do not need to match.
How are NULL values handled using set operators in a compound UNION query?
Answer: NULL values in one query are considered equal to NULL values in the other query, for the purposes of eliminating duplicates in a UNION.
Why are ROLLUP and CUBE the preferred methods for generating subtotals and grand totals for an aggregate query?
Answer: ROLLUP and CUBE need to make only one pass over the source table(s). Other methods, such as using a UNION between two similar queries, will make more than one pass.
Which operators can be used to compare a column to a single-row subquery?
Answer: The following operators can be used to compare a column to a single-row subquery: =, !=, >, <, >=, and <=.
A compound query that needs to find only the rows that are the same between the two queries should use the __________ set operator.
Answer: INTERSECT
True or false: The IN operator cannot be used with a single-row subquery.
Answer: False, using IN with a single-row subquery would be equivalent to using =.
Put the set operators UNION, UNION ALL, INTERSECT, and MINUS in order of precedence.
Answer: All of those operators have equal precedence and are evaluated left to right in a compound query.
What can be used to change the precedence of a pair of queries in a compound query with more than two queries?
Answer: As with any other part of a SQL query, parentheses may be used to change the evaluation order of the set operators.