Bird
0
0

What does the SQL INTERSECT operator do?

easy📝 Conceptual Q11 of 15
SQL - Set Operations
What does the SQL INTERSECT operator do?
ACombines rows from both queries including duplicates.
BReturns all rows from the first SELECT query.
CReturns all rows from the second SELECT query.
DReturns only the rows common to both SELECT queries.
Step-by-Step Solution
Solution:
  1. Step 1: Understand the purpose of INTERSECT

    The INTERSECT operator compares two SELECT queries and returns only the rows that appear in both results.
  2. Step 2: Compare with other set operators

    Unlike UNION or UNION ALL, INTERSECT excludes rows not common to both queries.
  3. Final Answer:

    Returns only the rows common to both SELECT queries. -> Option D
  4. Quick Check:

    INTERSECT = common rows [OK]
Quick Trick: INTERSECT keeps only shared rows between two queries [OK]
Common Mistakes:
MISTAKES
  • Confusing INTERSECT with UNION which combines all rows
  • Thinking INTERSECT returns rows from only one query
  • Assuming INTERSECT includes duplicates

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More SQL Quizzes