Bird
0
0

Which of the following shows the correct way to combine two SELECT statements using UNION ALL in SQL?

easy📝 Syntax Q3 of 15
SQL - Set Operations
Which of the following shows the correct way to combine two SELECT statements using UNION ALL in SQL?
ASELECT col1 FROM table1 UNION ALL SELECT col1 FROM table2;
BSELECT col1 FROM table1 UNIONALL SELECT col1 FROM table2;
CSELECT col1 FROM table1 UNION SELECT col1 FROM table2 ALL;
DSELECT col1 FROM table1 AND SELECT col1 FROM table2 UNION ALL;
Step-by-Step Solution
Solution:
  1. Step 1: Identify correct UNION ALL syntax

    The correct syntax requires the keyword UNION ALL between two SELECT statements.
  2. Step 2: Analyze options

    SELECT col1 FROM table1 UNION ALL SELECT col1 FROM table2; correctly uses UNION ALL with proper spacing and semicolon termination. Options B, C, and D have syntax errors or misplaced keywords.
  3. Final Answer:

    Option A -> Option A
  4. Quick Check:

    Correct keyword and spacing used [OK]
Quick Trick: UNION ALL must be two separate words between SELECTs [OK]
Common Mistakes:
MISTAKES
  • Writing UNIONALL as one word
  • Placing ALL after UNION incorrectly
  • Using AND instead of UNION ALL

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More SQL Quizzes