Week 13 Flashcards
Sub-queries and MERGE statements
Returns to the outer query one row of results consisting of one column only.
A. Correlated subquery
B. multiple-row subquery
C. single-row subquery
D. multiple-column subquery
C. single-row subquery
What operator is used when you need to compare against individual data?
WHERE
What operator is used when the returned value is compared to grouped data?
HAVING
Which of the following is NOT used in a multiple-row subquery?
A. Any
B. All
C. In
D. =
D. =
A ____ subquery references one or more columns in the outer query and tests whether the relationship or link is present.
correlated
The ____operator is used in a correlated subquery.
EXISTS
T/F: A MERGE statement takes one table and merges it into another table and must include what to do when the data is present and when it is not present.
True
Use WHEN MATCHED THEN
and a WHEN NOT MATCHED THEN statements
A subquery must contain at a minimum what two operators?
SELECT and FROM
T/F:
IN is not a valid operator for a multiple-column subquery.
False
T/F: A subquery nested in a SELECT clause cannot contain an ORDER BY clause.
True
T/F:
A multiple-column subquery cannot be nested in a WHERE clause
False
A complete query nested inside another query is called a(n) ____.
subquery