Bird
0
0

Why does checking WHERE right_table.key IS NULL after a LEFT JOIN reliably find unmatched rows, even if the right table has NULL values in other columns?

hard📝 Conceptual Q10 of 15
SQL - LEFT and RIGHT JOIN
Why does checking WHERE right_table.key IS NULL after a LEFT JOIN reliably find unmatched rows, even if the right table has NULL values in other columns?
ABecause NULL in right table columns always means a match
BBecause the join key is never NULL in matched rows, so NULL means no match
CBecause LEFT JOIN excludes rows with NULL keys
DBecause NULL values in other columns affect the join result
Step-by-Step Solution
Solution:
  1. Step 1: Understand join key role

    The join key in the right table is used to match rows; matched rows have non-NULL keys.
  2. Step 2: NULL key means no match

    If the right table key is NULL after LEFT JOIN, it means no matching row was found.
  3. Final Answer:

    Because the join key is never NULL in matched rows, so NULL means no match -> Option B
  4. Quick Check:

    NULL join key after LEFT JOIN = unmatched row [OK]
Quick Trick: Join key NULL after LEFT JOIN means no matching row [OK]
Common Mistakes:
MISTAKES
  • Assuming NULL in any right column means no match
  • Confusing NULL in data with NULL in join key
  • Thinking LEFT JOIN excludes NULL keys

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More SQL Quizzes