Oracle SQL Joins and Subqueries Flashcards
6 cards from real Oracle SQL practice questions. Tap to flip, then mark Knew It or Still Learning โ missed cards come back until you master them.
Read the first 6 Oracle SQL Joins and Subqueries flashcards as text
What is the difference between IN and EXISTS in Oracle SQL for subqueries?
Answer: EXISTS stops at first match (short-circuit), IN evaluates all subquery rows
EXISTS short-circuits as soon as a matching row is found, while IN collects all subquery results before comparing, making EXISTS more efficient for large subqueries.
In Oracle SQL, which join returns all rows from both tables, with NULLs where there is no match?
Answer: FULL OUTER JOIN
A FULL OUTER JOIN returns all rows from both tables, filling NULLs for unmatched columns on either side.
What does NOT EXISTS return if the subquery finds no matching rows in Oracle SQL?
Answer: TRUE
NOT EXISTS returns TRUE when the subquery finds no matching rows, making it useful for finding rows absent from another table.
Which Oracle SQL clause is used to specify the join condition in an ANSI-style join?
Answer: ON
The ON clause specifies the explicit join condition when column names differ between tables or when complex conditions are needed.
What happens if a scalar subquery returns more than one row in Oracle SQL?
Answer: Oracle raises ORA-01427 error
Oracle raises ORA-01427 'single-row subquery returns more than one row' error when a scalar subquery context receives multiple rows.
Which Oracle SQL join type produces results equivalent to UNION of LEFT JOIN and RIGHT JOIN?
Answer: FULL OUTER JOIN
A FULL OUTER JOIN is logically equivalent to UNION of a LEFT OUTER JOIN and a RIGHT OUTER JOIN on the same tables.