Delete Table in SQL
? DELETE TABLE in SQL
Actually, there is no DELETE TABLE statement in SQL.
If you want to remove an entire table (its structure and all data), you use:
? DROP TABLE
DROP TABLE table_name;Deletes the table structure and all data permanently.
Cannot be undone (unless you restore from backup).
Removes indexes, constraints, triggers related to that table too.
? Example
DROP TABLE employees;Deletes the employees table completely.
? If you want to just delete all rows but keep the table structure:
Use:
DELETE FROM table_name;or for faster operation:
TRUNCATE TABLE table_name;If you want help with any of these commands or their effects, just ask!