You have two ANSI-SQL tables with identical columns and need to combine them into one result set, removing duplicate rows. Which SQL operation should you use?
Choose an answer
Tap an option to check your answer.
Correct answer: Use the UNION operator in SQL to combine the tables..
Why this is the answer
The UNION operator combines the result sets of two or more SELECT statements into a single result set, and importantly, it automatically removes duplicate rows. This directly addresses the requirement of combining tables and removing duplicates. JOIN is used to combine rows from two or more tables based on a related column between them, not to stack entire result sets. Nested WITH statements (Common Table Expressions) are used for readability and breaking down complex queries, not for combining result sets in this manner. UNION ALL combines result sets like UNION, but it includes all duplicate rows, which contradicts the requirement to remove duplicates.
Pass your exam — without the endless answer hunt
Get every verified question and explanation for this exam in one place, and save hours of prep. 1,000+ certifications · 20+ languages · free to start.
Pass your exam faster → No card needed