DROP TABLE is a Data Definition Language (DDL) command used to permanently remove a table along with all of its data, indexes, constraints, and relationships from the database.
Unused or obsolete tables should be removed to keep the database clean and reduce unnecessary storage and maintenance.
After completing a testing project, the temporary TestEmployees table is no longer needed and can be permanently removed.
DROP TABLE Employees;
Developers and database administrators remove temporary tables, archived tables, or obsolete application tables during maintenance.
- Deletes the entire table.
- Removes all stored records.
- Deletes indexes and constraints.
- Cannot be undone without a backup.
- Frees database storage.
- Used for obsolete tables.
- It is a DDL command.
What happens when DROP TABLE is executed?
The table structure and all data stored inside it are permanently removed.
Can a dropped table be recovered?
Only if a backup or recovery mechanism is available.