DATABRICKS-DATA-ANALYST-ASSOCIATE practice question 7 of 15

A data analyst runs the following command: INSERT INTO stakeholders.suppliers TABLE stakeholders.new_suppliers; What is the result of running this command?

Full set: 117 questions
Answer options
A: The suppliers table now contains both the data it had before the command was run and the data from the new suppliers table, and any duplicate data is deleted.
B: The command fails because it is written incorrectly.
C: The suppliers table now contains both the data it had before the command was run and the data from the new suppliers table, including any duplicate data. Correct answer
D: The suppliers table now contains the data from the new suppliers table, and the new suppliers table now contains the data from the suppliers table.
E: The suppliers table now contains only the data from the new suppliers table.
Correct Answer:
C. The suppliers table now contains both the data it had before the command was run and the data from the new suppliers table, including any duplicate data.
Explanation

The INSERT INTO command is used to add new rows of data to an existing table. The syntax INSERT INTO targettable TABLE sourcetable is a valid Databricks SQL command that appends all rows from the sourcetable (stakeholders.newsuppliers) to the targettable (stakeholders.suppliers). This operation does not remove or alter the existing data in the target table, nor does it automatically check for or remove duplicate rows. Therefore, the suppliers table will contain its original data plus all the data from the newsuppliers table.

Why Incorrect

A: The INSERT INTO statement does not automatically delete duplicate data. A MERGE statement or a separate deduplication step would be required for that functionality. B: The syntax INSERT INTO ... TABLE ... is a valid and supported command in Databricks SQL for inserting all rows from one table into another. D: This describes a swap of data between two tables, which is not the function of an INSERT INTO command. E: This describes the behavior of an INSERT OVERWRITE command, which replaces all existing data in the target table, rather than appending to it.

References

1. Databricks SQL Language Reference

INSERT INTO: The official documentation states

"Inserts new rows into a table." It describes the action as adding data

not replacing it or performing deduplication. The contrast with INSERT OVERWRITE ("replaces the data of the table") and MERGE INTO (which has explicit clauses for handling matched rows) confirms this behavior.

Source: Databricks Documentation > SQL reference > Data manipulation language > INSERT INTO.

2. Databricks SQL Language Reference

INSERT OVERWRITE: This documentation explicitly states that INSERT OVERWRITE "replaces the data of the table

" which directly contradicts option E and highlights the appending nature of INSERT INTO.

Source: Databricks Documentation > SQL reference > Data manipulation language > INSERT OVERWRITE DIRECTORY and INSERT OVERWRITE TABLE.

Scroll to Top