Which JOIN type returns all rows when there is a match in either side?

Prepare for the TJR Bootcamp Test with flashcards and detailed questions. Get hints and explanations for each query. Ace your exam!

Multiple Choice

Which JOIN type returns all rows when there is a match in either side?

Explanation:
Preserving rows from both sides regardless of whether there’s a match is what the full outer join does. It brings back every row from both tables: if there is a matching row on the other side, the columns are combined; if there isn’t, the missing side’s columns appear as NULL. That means you get all rows that have a match on either side, plus any unmatched rows from either table. In contrast, inner joins keep only the rows where there is a match in both tables, left joins keep all rows from the left table (with NULLs for missing right-side data), and right joins do the same for the right table.

Preserving rows from both sides regardless of whether there’s a match is what the full outer join does. It brings back every row from both tables: if there is a matching row on the other side, the columns are combined; if there isn’t, the missing side’s columns appear as NULL. That means you get all rows that have a match on either side, plus any unmatched rows from either table. In contrast, inner joins keep only the rows where there is a match in both tables, left joins keep all rows from the left table (with NULLs for missing right-side data), and right joins do the same for the right table.

Subscribe

Get the latest from Examzify

You can unsubscribe at any time. Read our privacy policy