Using Subqueries Flashcards
6 cards from real 1Z0-071 practice questions. Tap to flip, then mark Knew It or Still Learning — missed cards come back until you master them.
Read the first 6 Using Subqueries flashcards as text
What is a subquery in Oracle SQL?
Answer: A SELECT statement nested inside another SQL statement
A subquery is a SELECT statement embedded within another SQL statement such as a SELECT, INSERT, UPDATE, or DELETE.
Where can a single-row subquery be used in a SELECT statement?
Answer: In the WHERE, HAVING, and SELECT clauses
Single-row subqueries can appear in the WHERE, HAVING, and SELECT clauses of the outer query.
Which comparison operator is INVALID when used with a multi-row subquery?
Answer: =
The = operator expects a single value; using it with a multi-row subquery causes an ORA-01427 error.
What does the EXISTS operator check in a subquery?
Answer: Whether the subquery returns at least one row
EXISTS returns TRUE if the subquery produces at least one row, regardless of column values.
A subquery that returns more than one column is called a:
Answer: Multiple-column subquery
A multiple-column subquery returns more than one column and is typically used in pairwise comparisons.
Which keyword pair allows a multi-row subquery to check if a value matches any value in the returned list?
Answer: Both = ANY and IN
Both IN and = ANY check if a value matches at least one value in the subquery's result set and are functionally equivalent.