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 structureDROP 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.