SQL – UNION and Set Operations
Practice SQL UNION and set operation interview questions. Cover UNION, UNION ALL, INTERSECT, and EXCEPT. Write queries and receive feedback on correctness and approach. Ideal for beginner SQL interview prep. First 2 questions are free with full feedback.
- Level Junior
- Questions 12
Try any track free — first 2 questions include full AI feedback. Subscribe to finish the track and unlock everything. Type or speak your answer — the first 2 questions include scoring and detailed AI feedback.
Sample sql – union and set operations interview questions
Preview 6 questions from this track in quiz order. In the full quiz you answer one at a time — type or speak — then get a score and feedback.
-
What is the difference between UNION and UNION ALL?
What a strong answer includes
UNION removes duplicates; UNION ALL keeps them.
-
Write a query that combines customer names from two tables.
What a strong answer includes
Uses UNION or UNION ALL correctly.
-
When would you use UNION ALL instead of UNION?
What a strong answer includes
When duplicates are acceptable or performance matters.
-
What rules apply when using UNION?
What a strong answer includes
Same number of columns and compatible types.
-
Explain INTERSECT.
What a strong answer includes
Returns rows common to both queries.
-
Explain EXCEPT (or MINUS).
What a strong answer includes
Returns rows in the first query but not the second.