
Answer-first summary for fast verification
Answer: MERGE, because it is specifically designed to handle deduplication by combining data from two tables and writing the result to a target table, efficiently removing duplicates in the process.
Option C is the correct answer because the MERGE command is specifically designed to deduplicate data upon writing. It efficiently combines data from two tables and writes the result to a target table, while removing duplicates, making it the best choice for ensuring data integrity and meeting compliance and scalability requirements. Option A is incorrect because, although it creates a new table, it does not inherently deduplicate data. Option B is incorrect because it overwrites data but does not deduplicate. Option D is incorrect because, while it is efficient for inserting large volumes of data, it does not deduplicate.
Author: LeetQuiz Editorial Team
Ultimate access to all questions.
In a scenario where you are working with a large dataset in a source table that contains duplicates, and you need to ensure that the data written to a target table is deduplicated to meet compliance and scalability requirements. Considering the need for efficiency and the ability to handle large volumes of data, which command should you use and why? Choose the best option from the following:
A
CREATE OR REPLACE TABLE, because it allows you to create a new table with the deduplicated data, but it requires additional steps to ensure data integrity and does not inherently deduplicate data.
B
INSERT OVERWRITE, because it allows you to overwrite the target table with the deduplicated data, but it lacks the capability to deduplicate data during the insertion process.
C
MERGE, because it is specifically designed to handle deduplication by combining data from two tables and writing the result to a target table, efficiently removing duplicates in the process.
D
COPY INTO, because it is optimized for inserting large volumes of data into a target table, but it does not provide deduplication capabilities.
No comments yet.