Loading

Quipoin Menu

Learn • Practice • Grow

sql / SQL UNION
mcq
Direction: Choose the correct option

Q1.

What does UNION do?
A. Joins tables
B. Combines result sets, removes duplicates
C. Combines tables
D. Sorts results
Direction: Choose the correct option

Q2.

SELECT city FROM customers UNION SELECT city FROM suppliers;
What will this return?
A. All cities with duplicates
B. Only supplier cities
C. Only customer cities
D. Unique cities from both
Direction: Choose the correct option

Q3.

What's the difference between UNION and UNION ALL?
A. UNION ALL removes duplicates
B. Both same
C. UNION removes duplicates, UNION ALL keeps duplicates
D. UNION is faster
Direction: Choose the correct option

Q4.

What rules must UNION queries follow?
A. Same number of columns, compatible data types
B. Same database
C. Any columns
D. Same table names
Direction: Choose the correct option

Q5.

SELECT name, 'Customer' AS type FROM customers UNION SELECT name, 'Supplier' AS type FROM suppliers ORDER BY name;
Where is ORDER BY applied?
A. To each SELECT separately
B. To final combined result
C. Before UNION
D. Not allowed