Bird
0
0

Which of the following statements about UNION ALL is TRUE?

easy📝 Conceptual Q2 of 15
SQL - Set Operations
Which of the following statements about UNION ALL is TRUE?
A<code>UNION ALL</code> only works with tables having the same number of columns
B<code>UNION ALL</code> always sorts the combined result set
C<code>UNION ALL</code> removes duplicate rows automatically
D<code>UNION ALL</code> can return duplicate rows from combined queries
Step-by-Step Solution
Solution:
  1. Step 1: Check sorting behavior of UNION ALL

    UNION ALL does not sort results automatically.
  2. Step 2: Check duplicate handling

    UNION ALL returns all rows including duplicates.
  3. Step 3: Check column count requirement

    Both UNION and UNION ALL require same number of columns in queries.
  4. Final Answer:

    UNION ALL can return duplicate rows from combined queries -> Option D
  5. Quick Check:

    UNION ALL duplicates allowed = TRUE [OK]
Quick Trick: UNION ALL returns duplicates and does not sort [OK]
Common Mistakes:
MISTAKES
  • Assuming UNION ALL sorts results
  • Thinking UNION ALL removes duplicates
  • Ignoring column count requirement

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More SQL Quizzes