Bird
0
0

Which SQL clause combination is used to find records in table A that do not have matching records in table B?

easy📝 Conceptual Q2 of 15
SQL - LEFT and RIGHT JOIN
Which SQL clause combination is used to find records in table A that do not have matching records in table B?
ALEFT JOIN B ON condition WHERE B.key IS NULL
BINNER JOIN B ON condition WHERE B.key IS NOT NULL
CRIGHT JOIN B ON condition WHERE A.key IS NULL
DFULL JOIN B ON condition WHERE A.key IS NOT NULL
Step-by-Step Solution
Solution:
  1. Step 1: Identify join type for unmatched rows

    LEFT JOIN keeps all rows from A and matches from B; unmatched B rows are NULL.
  2. Step 2: Filter unmatched rows with WHERE clause

    WHERE B.key IS NULL filters rows in A without matches in B.
  3. Final Answer:

    LEFT JOIN B ON condition WHERE B.key IS NULL -> Option A
  4. Quick Check:

    LEFT JOIN + NULL filter = unmatched rows [OK]
Quick Trick: Use LEFT JOIN + WHERE right_table.key IS NULL to find unmatched [OK]
Common Mistakes:
MISTAKES
  • Using INNER JOIN which excludes unmatched rows
  • Confusing RIGHT JOIN with LEFT JOIN
  • Filtering on wrong table's NULL values

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More SQL Quizzes