In SQL, which join returns all rows from both tables, with NULLs where there is no match?

Prepare for the DDR Data Science Interview. Practice with detailed questions and explanations to enhance your knowledge. Ace your interview!

Multiple Choice

In SQL, which join returns all rows from both tables, with NULLs where there is no match?

Explanation:
A full outer join is the operation that returns every row from both tables and fills in NULLs where there is no matching row in the other table. This is the broadest type of join: it keeps all data from both sides, showing non-matching rows with NULLs on the side that has no match. Think of it as taking the union of all matches plus all unmatched rows from either side. In contrast, an inner join would drop any row that doesn’t have a match in the other table, while a left outer join would keep all rows from the left table (with NULLs for missing right-side data), and a right outer join would do the opposite. So the described behavior—every row from both tables with NULLs where there’s no match—matches a full outer join exactly.

A full outer join is the operation that returns every row from both tables and fills in NULLs where there is no matching row in the other table. This is the broadest type of join: it keeps all data from both sides, showing non-matching rows with NULLs on the side that has no match.

Think of it as taking the union of all matches plus all unmatched rows from either side. In contrast, an inner join would drop any row that doesn’t have a match in the other table, while a left outer join would keep all rows from the left table (with NULLs for missing right-side data), and a right outer join would do the opposite.

So the described behavior—every row from both tables with NULLs where there’s no match—matches a full outer join exactly.

Subscribe

Get the latest from Examzify

You can unsubscribe at any time. Read our privacy policy