Certified Data Analyst Associate Exam QuestionsBrowse all questions from this exam

Certified Data Analyst Associate Exam - Question 21


A data analyst runs the following command:

INSERT INTO stakeholders.suppliers TABLE stakeholders.new_suppliers;

What is the result of running this command?

Show Answer
Correct Answer: BC

The INSERT INTO command in SQL is used to add data to an existing table. When using the TABLE keyword, it indicates that data from another table (in this case, new_suppliers) is to be inserted into the target table (suppliers). Therefore, the suppliers table will contain both its previous data and the data from the new_suppliers table, including any duplicate data.

Discussion

3 comments
Sign in to comment
libbsterOption: C
Mar 18, 2024

C is correct based on official Databricks documentation and example: INSERT INTO students TABLE visiting_students;

Ayush24Option: C
Apr 11, 2024

As per Databrick documents, https://docs.databricks.com/en/sql/language-manual/sql-ref-syntax-dml-insert-into.html We can Insert using a TABLE clause.

DevscopeOption: C
Jan 29, 2024

Try the following code, you will see that it runs without a problem: DROP TABLE IF EXISTS test; CREATE TABLE test (id INT, name VARCHAR(64)); INSERT INTO test VALUES (1, 'Person1'), (2, 'Person2'); -- SELECT * FROM test; DROP TABLE IF EXISTS test2; CREATE TABLE test2 (id INT, name VARCHAR(64)); INSERT INTO test2 VALUES (3, 'Person3'), (4, 'Person4'); -- SELECT * FROM test2; INSERT INTO test TABLE test2; SELECT * FROM test