
Answer-first summary for fast verification
Answer: Use the UNION operator in SQL to combine the tables.
The correct approach is to use the UNION operator. UNION combines the results of two SELECT statements and removes duplicate rows, which aligns with the requirement to combine tables and eliminate duplicates. The JOIN operator (A) is for combining columns based on a condition, not rows. Nested WITH statements (B) are for organizing subqueries, not directly combining tables. UNION ALL (D) combines results but does not remove duplicates, so it doesn't meet the requirement.
Author: LeetQuiz Editorial Team
Ultimate access to all questions.
What is the correct ANSI-SQL compliant method to combine two tables with identical columns into a single table while removing duplicate rows?
A
Use the JOIN operator in SQL to combine the tables.
B
Use nested WITH statements to combine the tables.
C
Use the UNION operator in SQL to combine the tables.
D
Use the UNION ALL operator in SQL to combine the tables.
No comments yet.