Bird
0
0

Why does a FULL OUTER JOIN sometimes produce duplicate rows when joining tables with non-unique keys?

hard📝 Conceptual Q10 of 15
SQL - Advanced Joins
Why does a FULL OUTER JOIN sometimes produce duplicate rows when joining tables with non-unique keys?
ABecause FULL OUTER JOIN removes duplicates automatically.
BBecause it matches every combination of rows with the same join key from both tables.
CBecause the ON condition is ignored in FULL OUTER JOIN.
DBecause FULL OUTER JOIN only returns rows with unique keys.
Step-by-Step Solution
Solution:
  1. Step 1: Understand join behavior with non-unique keys

    When keys are not unique, join matches every pair of rows with the same key, causing duplicates.
  2. Step 2: FULL OUTER JOIN includes all matches and unmatched rows

    This behavior applies to FULL OUTER JOIN as well, so duplicates appear if keys repeat.
  3. Final Answer:

    Because it matches every combination of rows with the same join key from both tables. -> Option B
  4. Quick Check:

    Non-unique keys cause multiple matches = B [OK]
Quick Trick: Non-unique keys cause multiple row combinations in joins [OK]
Common Mistakes:
MISTAKES
  • Thinking FULL OUTER JOIN removes duplicates automatically
  • Assuming ON condition is ignored

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More SQL Quizzes