QuestionQ2

VerifiedDatabase Management and Maintenance

A database administrator is migrating data from a legacy table to a newer table. Both tables have the same columns, and some data may overlap.

Which SQL command should the administrator use to ensure that records from the two tables are not duplicated?

Explanation

UNION combines the rows returned from two compatible queries and removes duplicate rows by default. UNION ALL would retain duplicates; joins serve different purposes, and INTERSECT would return only the rows shared by both tables.

Learn more

Community Discussion

No comments yet. Be the first to start the discussion!