Labs ICT
โญ Pro Login

DROP TABLE

DROP TABLE deletes an entire table โ€” structure and all data. Gone. Be careful with this one.

Basic DROP TABLE

DROP TABLE employees;

Poof. The table is gone. Not the rows, the whole table. You would need to CREATE it again to use it.

DROP TABLE IF EXISTS

Prevent errors if the table does not exist:

DROP TABLE IF EXISTS employees;

This is the safer version. It will not throw an error if the table is already gone.

DROP vs DELETE

A lot of beginners mix these up:

  • DELETE FROM students โ€” removes the data, keeps the table structure
  • DROP TABLE students โ€” removes the table and all its data completely

Use DELETE when you want to clear data but keep using the table. Use DROP when you are done with the table entirely.

๐Ÿงช Quick Quiz

What is the difference between DELETE FROM students and DROP TABLE students?