Bird
0
0

Which of the following is true about UNION ALL in PostgreSQL?

easy📝 Conceptual Q2 of 15
PostgreSQL - Set Operations and Advanced Queries
Which of the following is true about UNION ALL in PostgreSQL?
AIt removes duplicate rows from combined results
BIt sorts the combined results automatically
CIt only returns rows that appear in both queries
DIt combines results and keeps all duplicates
Step-by-Step Solution
Solution:
  1. Step 1: Recall UNION ALL behavior

    UNION ALL combines results from two queries and keeps all rows, including duplicates.
  2. Step 2: Eliminate incorrect options

    UNION removes duplicates, INTERSECT returns common rows, and sorting is not automatic with UNION ALL.
  3. Final Answer:

    It combines results and keeps all duplicates -> Option D
  4. Quick Check:

    UNION ALL = Keeps duplicates [OK]
Quick Trick: UNION ALL keeps duplicates; no automatic sorting [OK]
Common Mistakes:
  • Confusing UNION ALL with UNION
  • Assuming UNION ALL sorts results
  • Thinking UNION ALL returns only common rows

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More PostgreSQL Quizzes