ExamGecko
Question list
Search
Search

Question 28 - DS0-001 discussion

Report
Export

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
Answers
A.
UNION
B.
JOIN
Answers
B.
JOIN
C.
IINTERSECT
Answers
C.
IINTERSECT
D.
CROSS JOIN
Answers
D.
CROSS JOIN
Suggested 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 theUNIONclause to combine the records from the legacy table and the newer table into a single result set. TheUNIONclause 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.

asked 02/10/2024
Sumit Dhar
47 questions
User
Your answer:
0 comments
Sorted by

Leave a comment first