QuestionQ3

VerifiedExecuting queries using Databricks SQL and Databricks SQL Warehouses

A data analyst executes the following command:

INSERT INTO stakeholders.suppliers TABLE stakeholders.new_suppliers;  

What happens when this command is executed?

Explanation

In Databricks SQL, INSERT INTO accepts a TABLE clause as its source, so INSERT INTO stakeholders.suppliers TABLE stakeholders.new_suppliers; is valid shorthand for inserting all rows of new_suppliers. INSERT INTO is additive: the existing rows of suppliers are kept and the rows from new_suppliers are appended, with no deduplication, so duplicates remain. The source table is not modified.

Learn more

Community Discussion

No comments yet. Be the first to start the discussion!