The DROP TABLE statement is used to permanently remove a table and all of its data, structure, indexes, rules, triggers, and constraints from the database. Unlike DELETE, which only removes rows but keeps the table, DROP TABLE deletes the entire table itself.
When a table is dropped using this command, its data, structure, and relationships are permanently removed. This action cannot be undone, so it should be used very carefully—especially in production environments.
Syntax
DROP TABLE table_name;
Drop a Table
This will permanently remove the students table and all of its data.
DROP TABLE students;
Drop Only if Table Exists (Safer Way)
Ensures no error occurs if the students table does not exist.
DROP TABLE IF EXISTS students;