Bird
0
0

What is the main purpose of using UNION in SQL queries?

easy📝 Conceptual Q1 of 15
SQL - Set Operations
What is the main purpose of using UNION in SQL queries?
ATo combine results from two queries and remove duplicates
BTo join two tables based on a common column
CTo update records in a table
DTo delete rows from a table
Step-by-Step Solution
Solution:
  1. Step 1: Understand UNION operation

    UNION combines the results of two SELECT queries into one result set.

  2. Step 2: Check duplicate handling

    UNION removes duplicate rows by default, unlike UNION ALL.

  3. Final Answer:

    To combine results from two queries and remove duplicates -> Option A
  4. Quick Check:

    UNION purpose = combine and remove duplicates [OK]
Quick Trick: UNION merges results and removes duplicates by default [OK]
Common Mistakes:
MISTAKES
  • Confusing UNION with JOIN
  • Thinking UNION updates or deletes data
  • Assuming UNION keeps duplicates

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More SQL Quizzes