
Answer-first summary for fast verification
Answer: FULL OUTER JOIN
The correct command is **FULL OUTER JOIN**, which returns all rows from both tables, matching where possible and appending NULLs where there is no match. This contrasts with: - **INNER JOIN**: Only rows with matching keys in both tables. - **UNION**: Combines results of two queries, removing duplicates unless ALL is specified. - **LEFT OUTER JOIN**: All rows from the left table, matched rows from the right, NULLs for no match. - **MERGE**: Updates, inserts, or deletes rows in a target table based on a source table.
Author: LeetQuiz Editorial Team
Ultimate access to all questions.
A data engineer aims to horizontally combine two tables in a query, using a shared column as the key. The desired outcome includes rows with key values present in both tables, plus any non-matching rows from either table. Which SQL command achieves this?
A
INNER JOIN
B
FULL OUTER JOIN
C
UNION
D
LEFT OUTER JOIN
E
MERGE
No comments yet.