Bird
0
0

When using INTERSECT between two queries, what must be true about their columns?

easy📝 Conceptual Q2 of 15
SQL - Set Operations
When using INTERSECT between two queries, what must be true about their columns?
AThey must have identical ORDER BY clauses.
BThey must have the same column names regardless of data types.
CThey must have the same number of columns with compatible data types.
DThey must select from the same database schema.
Step-by-Step Solution
Solution:
  1. Step 1: Recall INTERSECT rules

    INTERSECT requires the same number of columns with compatible types to compare rows.
  2. Step 2: Evaluate options

    Only They must have the same number of columns with compatible data types. correctly states the column matching rule for INTERSECT.
  3. Final Answer:

    They must have the same number of columns with compatible data types. -> Option C
  4. Quick Check:

    Set operation column matching = D [OK]
Quick Trick: INTERSECT needs matching columns and types [OK]
Common Mistakes:
MISTAKES
  • Confusing column names with data types
  • Assuming same schema is required
  • Thinking ORDER BY must match

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More SQL Quizzes