
Answer-first summary for fast verification
Answer: CREATE OR REPLACE TABLE
The `CREATE OR REPLACE TABLE` (CRAS) statement is the correct choice because it allows you to atomically replace both the data and schema of a table each time it executes. If the schema of the new records doesn't match the existing records, the schema is overwritten with the new one. Additionally, if the table doesn't already exist, it creates a new table. Other options like `INSERT OVERWRITE` can only overwrite data with records that match the current table schema, and operations like `INSERT INTO`, `MERGE INTO`, and `COPY INTO` have limitations regarding schema matching and the types of operations they can perform.
Author: LeetQuiz Editorial Team
Ultimate access to all questions.
No comments yet.