
Answer-first summary for fast verification
Answer: DROP TABLE database_name.table_name;
The correct answer is B because DROP TABLE database_name.table_name; is the proper SQL syntax for removing a managed table and its underlying data files from a specific database in Databricks. Option A (DROP DATABASE) would delete the entire database, affecting other tables. Option C (DELETE TABLE) uses incorrect syntax as DELETE is for rows, not tables. Option D and E use invalid FROM clauses, which are not part of standard DROP TABLE syntax. The community discussion shows 100% consensus on B with upvoted comments confirming this is the correct approach.
Author: LeetQuiz Editorial Team
Ultimate access to all questions.
A data engineer has a managed table named table_name in a database named database_name. They want to delete this table and all of its underlying data files. The other tables in the database must remain unaffected.
Which command will successfully complete this task without causing an error?
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;
No comments yet.