
Ultimate access to all questions.
Which of the following SQL keywords can be used to append new rows to an existing Delta table?
A
UPDATE
B
COPY
C
INSERT INTO
D
DELETE
E
UNION
Explanation:
INSERT INTO is the correct SQL keyword for appending new rows to an existing Delta table in Databricks.
Let's analyze each option:
A. UPDATE: This keyword is used to modify existing rows in a table, not to append new rows. It updates column values of existing records based on specified conditions.
B. COPY: This is not a standard SQL keyword for data manipulation in Delta tables. While Databricks has a COPY INTO command for loading data from external sources, it's not a standard SQL DML keyword for appending rows to existing tables.
C. INSERT INTO: CORRECT ANSWER - This SQL keyword is specifically designed to append new rows to an existing table. In Databricks Delta tables, INSERT INTO adds new records to the table while preserving existing data.
D. DELETE: This keyword removes rows from a table, not appends them. It's used for deleting existing records based on specified conditions.
E. UNION: This is a set operator used to combine the results of two SELECT statements, not to append rows directly to a table. While you can use UNION in a SELECT statement that feeds into an INSERT, UNION itself is not a DML command for table modification.
Key Points:
INSERT INTO is the standard SQL DML command for adding new rows to existing tablesINSERT INTO ensures data consistency and supports ACID transactionsINSERT INTO table_name (column1, column2, ...) VALUES (value1, value2, ...) or INSERT INTO table_name SELECT ...