🗑️ DROP Command in SQL
Last Updated: January 2026
The DROP command is a DDL (Data Definition Language) command used to permanently remove database objects.
👉 DROP deletes the structure and the data together.
Using DROP, you can remove:
- Tables
- Databases
- Views
- Indexes
Hinglish Tip 🗣: Jab kisi table ya database ko completely hataana ho, bina recovery ke, tab DROP use hota hai.
DROP TABLE
Deletes a table completely.
DROP TABLE table_name;
-- or
DROP TABLE if exists table_name;
Example
DROP TABLE employees;
After this:
- Table structure delete.
- Table data delete.
- Table name delete.
Everything is removed permanently.
DROP DATABASE
Deletes an entire database with all its tables.
DROP DATABASE database_name;
-- or
DROP DATABASE if exists database_name;
Example
DROP DATABASE company_db;
⚠️ This removes:
- All tables
- All data
- All schema objects
🚨 Important Warnings
- DROP is auto-committed
- Cannot be rolled back
- Extremely dangerous on production databases
- Always double-check before executing