Which SQL join returns all rows from both tables, with NULL values for…
2026
Which SQL join returns all rows from both tables, with NULL values for non-matching rows ?
- A.
INNER JOIN.
- B.
LEFT JOIN
- C.
RIGHT JOIN
- D.
FULL OUTER JOIN
Attempted by 115 students.
Show answer & explanation
Correct answer: D
The correct answer is FULL OUTER JOIN. This join type combines the results of both a LEFT JOIN and a RIGHT JOIN, ensuring that every row from both tables is included in the final result set. When there is no matching record between the two tables based on the join condition, the database fills the missing columns with NULL values. This distinguishes it from INNER JOIN, which only returns rows where matches exist in both tables, and LEFT or RIGHT JOINs, which preserve all rows from only one specific table while discarding non-matching rows from the other. Therefore, to retrieve all data from both sides regardless of matches, FULL OUTER JOIN is the precise tool required.