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

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?

A. UNION

B. JOIN

C. IINTERSECT

D. CROSS JOIN

Answer: A

Explanation:

The SQL command that the administrator should use to ensure that records from the two tables are not duplicated is option A. This command uses the UNION clause to combine the records from the legacy table and the newer table into a single result set. The UNION clause also eliminates any duplicate records that may exist in both tables, and sorts the result by default. The other options either do not produce the desired result or have syntax errors. For example, option B would join the records from the two tables based on a common column, but not remove any duplicates; option C would return only the records that are common to both tables, but not the ones that are unique to each table; option D would produce a Cartesian product of the records from the two tables, which would increase the number of duplicates.

Reference: CompTIA DataSys+ Course Outline, Domain 1.0 Database Fundamentals, Objective 1.2 Given a scenario, execute database tasks using scripting and programming languages.

Latest DS0-001 Dumps Valid Version with 80 Q&As

Latest And Valid Q&A | Instant Download | Once Fail, Full Refund

Subscribe
Notify of
guest
0 Comments
Inline Feedbacks
View all comments