Bird
0
0

Which set operation returns only the rows common to both SELECT queries?

easy📝 Conceptual Q2 of 15
PostgreSQL - Set Operations and Advanced Queries
Which set operation returns only the rows common to both SELECT queries?
AUNION
BINTERSECT
CEXCEPT
DJOIN
Step-by-Step Solution
Solution:
  1. Step 1: Identify INTERSECT behavior

    INTERSECT returns only rows that appear in both SELECT query results.
  2. Step 2: Compare with other operations

    UNION combines all unique rows; EXCEPT returns rows in first query but not second; JOIN combines rows based on matching columns.
  3. Final Answer:

    INTERSECT returns only common rows -> Option B
  4. Quick Check:

    INTERSECT = Common rows only [OK]
Quick Trick: INTERSECT finds common rows between queries [OK]
Common Mistakes:
  • Confusing INTERSECT with UNION
  • Thinking JOIN is a set operation
  • Assuming EXCEPT returns common rows

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More PostgreSQL Quizzes