CompTIA DataSys+ (DS0-001) — Question 2

A database administrator is migrating the information in a legacy table to a newer table. Both tables contain the same columns, and some of the data may overlap.
Which of the following SQL commands should the administrator use to ensure that records from the two tables are not duplicated?

Answer options

Correct answer: A

Explanation

The correct answer is A, UNION, as it combines the results from both tables while removing duplicate records. The JOIN command (B) merges rows based on related columns but does not eliminate duplicates. INTERSECT (C) returns only the rows that exist in both tables, which is not suitable for this scenario, and CROSS JOIN (D) produces a Cartesian product of both tables, resulting in additional rows rather than preventing duplication.