Bird
0
0

Why does the SQL EXCEPT operator remove duplicate rows from the result?

hard📝 Conceptual Q10 of 15
SQL - Set Operations
Why does the SQL EXCEPT operator remove duplicate rows from the result?
ABecause EXCEPT returns a set, which by definition has unique rows
BBecause EXCEPT automatically applies GROUP BY
CBecause EXCEPT only works on primary keys
DBecause EXCEPT joins tables and removes duplicates
Step-by-Step Solution
Solution:
  1. Step 1: Understand set operations

    EXCEPT is a set operation that returns distinct rows from the first query not in the second.
  2. Step 2: Explain uniqueness

    Sets do not allow duplicates, so EXCEPT removes duplicates automatically.
  3. Final Answer:

    Because EXCEPT returns a set, which by definition has unique rows -> Option A
  4. Quick Check:

    EXCEPT returns distinct rows by set behavior [OK]
Quick Trick: EXCEPT returns distinct rows because it works like a set [OK]
Common Mistakes:
MISTAKES
  • Thinking EXCEPT applies GROUP BY
  • Assuming EXCEPT only works on keys
  • Confusing EXCEPT with JOIN

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More SQL Quizzes