Which of the SQL statements given below is used to remove a table and its data from the...
Micron technical mcq question, verified with a worked answer. Free to practise - no sign-up.
Which of the SQL statements given below is used to remove a table and its data from the database?
Show answer & explanation
The DROP statement removes an entire table structure and its data from the database. DELETE only removes rows but keeps the table structure, ALTER modifies table structure, and REMOVE is not a valid SQL keyword.
Step-by-step Derivation:
In SQL, there are distinct commands for different operations: DROP TABLE removes the entire table object and all its data from the database schema; DELETE FROM removes only the data rows but preserves the table structure; ALTER TABLE modifies table definitions; REMOVE is not a standard SQL statement. Therefore, DROP is the correct answer for completely removing a table and its data.