Bird
0
0

Given two tables:

medium📝 query result Q13 of 15
SQL - Set Operations
Given two tables:
Table A: {1, 2, 3}
Table B: {2, 3, 4}
What is the result of SELECT * FROM A INTERSECT SELECT * FROM B;?
A{2, 3}
B{1, 2, 3}
C{1, 4}
D{1, 2, 3, 4}
Step-by-Step Solution
Solution:
  1. Step 1: Understand INTERSECT operation

    INTERSECT returns only rows present in both tables.
  2. Step 2: Find common elements in Table A and Table B

    Common elements are 2 and 3.
  3. Final Answer:

    {2, 3} -> Option A
  4. Quick Check:

    INTERSECT = common rows [OK]
Quick Trick: INTERSECT returns only common rows [OK]
Common Mistakes:
MISTAKES
  • Confusing INTERSECT with UNION
  • Including all rows from both tables
  • Mixing up EXCEPT with INTERSECT

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More SQL Quizzes