CERTIFIED-DATA-ANALYST-ASSOCIATE · Question #2
CERTIFIED-DATA-ANALYST-ASSOCIATE Question #2: Real Exam Question with Answer & Explanation
The correct answer is B: DROP TABLE database_name.table_name;. DROP TABLE database_name.table_name is the correct command because DROP TABLE removes both the table's metadata and its underlying data files from the database - exactly what's needed for a managed table. The fully qualified database_name.table_name syntax targets only the specif
Question
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?
Options
- ADROP DATABASE database_name;
- BDROP TABLE database_name.table_name;
- CDELETE TABLE database_name.table_name;
- DDELETE TABLE table_name FROM database_name;
- EDROP TABLE table_name FROM database_name;
Explanation
DROP TABLE database_name.table_name is the correct command because DROP TABLE removes both the table's metadata and its underlying data files from the database - exactly what's needed for a managed table. The fully qualified database_name.table_name syntax targets only the specific table, leaving all other tables in the database intact.
Why the others fail:
- A -
DROP DATABASEdeletes the entire database and all its tables, violating the requirement to preserve the rest. - C & D -
DELETE TABLEis not valid SQL syntax;DELETEoperates on rows within a table, not on tables themselves. - E -
DROP TABLE table_name FROM database_nameis not valid syntax; SQL does not useFROMto specify the database in aDROP TABLEstatement.
Memory tip: Think of DROP as the "nuclear" table command (removes structure + data), while DELETE only removes rows. And always qualify the table with database.table - never use FROM with DROP TABLE.
Community Discussion
No community discussion yet for this question.