Bird
0
0

What does the UNION operation do when combining results from two SELECT queries?

easy📝 Conceptual Q11 of 15
SQL - Set Operations
What does the UNION operation do when combining results from two SELECT queries?
ASorts the results in ascending order
BCombines results and removes duplicate rows
CCombines results and keeps all duplicate rows
DJoins tables based on a common column
Step-by-Step Solution
Solution:
  1. Step 1: Understand UNION operation

    The UNION operation combines results from two SELECT queries into one result set.
  2. Step 2: Check duplicate handling

    UNION removes duplicate rows, unlike UNION ALL which keeps duplicates.
  3. Final Answer:

    Combines results and removes duplicate rows -> Option B
  4. Quick Check:

    UNION removes duplicates = C [OK]
Quick Trick: UNION removes duplicates; UNION ALL keeps them [OK]
Common Mistakes:
MISTAKES
  • Confusing UNION with UNION ALL
  • Thinking UNION sorts results automatically
  • Mixing UNION with JOIN operations

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More SQL Quizzes