Drop table is used to delete the table with all records.
Syntax:-
DROP TABLE tableName
Example:- Suppose we have an employees table
+----+------------+-----------+----------------+------------+
| id | first_name | last_name | email | address |
+----+------------+-----------+----------------+------------+
| 1 | John | Tailor | john@abc.com | California |
| 2 | Rom | Tailor | rom@abc.com | California |
| 3 | Andrew | Symonds | andrew@abc.com | Sydney |
| 4 | Miacle | clerk | miacle@abc.com | sydney |
| 5 | Sachin | Tendulkar | sachin@abc.com | Mumbai |
Now Drop the table
DROP TABLE employees
After performing the operation, Now check employees table is exists or not
SELECT * FROM employees
Output:-
Table ’employees_system.employees’ doesn’t exist
SQL Drop Table – Interview Questions
Q 1: What does DROP TABLE do?
Ans: It permanently deletes a table and its data.
Q 2: Syntax of DROP TABLE?
Ans: DROP TABLE table_name;
Q 3: Is DROP TABLE reversible?
Ans: No, unless a backup exists.
Q 4: Can we drop multiple tables at once?
Ans: Yes, by listing table names separated by commas.
Q 5: Who can drop a table?
Ans: Users with proper privileges.
SQL Drop Table – Objective Questions (MCQs)
Q1. Which SQL command is used to delete a table permanently?
Q2. What happens when a table is dropped?
Q3. DROP TABLE belongs to which SQL category?
Q4. Which clause prevents an error if the table does not exist?
Q5. Can a dropped table be recovered easily?