Bird
0
0

Why does the SQL INTERSECT operator require the same number and order of columns in both SELECT statements?

hard📝 Conceptual Q10 of 15
SQL - Set Operations
Why does the SQL INTERSECT operator require the same number and order of columns in both SELECT statements?
ABecause INTERSECT only works with numeric columns
BBecause INTERSECT automatically rearranges columns internally
CBecause INTERSECT compares rows column by column to find exact matches
DBecause INTERSECT ignores column order and number
Step-by-Step Solution
Solution:
  1. Step 1: Understand how INTERSECT compares rows

    INTERSECT compares each row from both queries column by column to find exact matches.
  2. Step 2: Explain requirement for matching columns

    Same number and order of columns ensure correct comparison of corresponding values.
  3. Final Answer:

    Because INTERSECT compares rows column by column to find exact matches -> Option C
  4. Quick Check:

    INTERSECT needs matching columns for row comparison [OK]
Quick Trick: INTERSECT compares rows column-wise, so columns must match [OK]
Common Mistakes:
MISTAKES
  • Thinking INTERSECT works only on numeric columns
  • Assuming INTERSECT rearranges columns automatically
  • Believing column order does not matter

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More SQL Quizzes