Databricks Certified Data Analyst Associate — Question 11
A data analyst has a managed table table_name in database database_name. They would now like to remove the table from the database and all of the data files associated with the table. The rest of the tables in the database must continue to exist.
Which of the following commands can the analyst use to complete the task without producing an error?
Answer options
- A. DROP DATABASE database_name;
- B. DROP TABLE database_name.table_name;
- C. DELETE TABLE database_name.table_name;
- D. DELETE TABLE table_name FROM database_name;
- E. DROP TABLE table_name FROM database_name;
Correct answer: B
Explanation
The correct answer is B, as the DROP TABLE command is specifically designed to remove a table and its associated data files from a database. Option A would delete the entire database, and options C, D, and E are invalid commands for removing a table in SQL syntax.