Bird
0
0

Which of the following is the correct syntax to combine two SELECT queries using UNION in SQL?

easy📝 Syntax Q12 of 15
SQL - Set Operations
Which of the following is the correct syntax to combine two SELECT queries using UNION in SQL?
AUNION SELECT * FROM table1, SELECT * FROM table2;
BSELECT * FROM table1 JOIN UNION SELECT * FROM table2;
CSELECT * FROM table1 UNION SELECT * FROM table2;
DSELECT * FROM table1 AND SELECT * FROM table2 UNION;
Step-by-Step Solution
Solution:
  1. Step 1: Recall correct UNION syntax

    The correct syntax is to write one SELECT query, then UNION, then another SELECT query.
  2. Step 2: Check each option for syntax errors

    SELECT * FROM table1 UNION SELECT * FROM table2; follows the correct syntax. Options A, B, and D have incorrect keywords or order.
  3. Final Answer:

    SELECT * FROM table1 UNION SELECT * FROM table2; -> Option C
  4. Quick Check:

    Correct UNION syntax = SELECT * FROM table1 UNION SELECT * FROM table2; [OK]
Quick Trick: UNION joins two SELECT queries directly [OK]
Common Mistakes:
MISTAKES
  • Adding JOIN keyword with UNION
  • Using commas instead of UNION
  • Placing UNION at the end incorrectly

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More SQL Quizzes