SQL > Data Definition Language (DDL) > Drop Database Statement

Sometimes we may decide that we need to delete of an entire database in the RDBMS. In fact, if we cannot do so, we would be faced with a maintenance nightmare. Fortunately, SQL allows us to do it, as we can use the DROP DATABASE command.

The SQL DROP DATABASE command permanently removes an entire database and all objects within it — use with caution, as this action is irreversible without a backup.

Syntax

The syntax for DROP DATABASE is,

DROP DATABASE "database_name";

Example

To drop the HOLIDAYS database that we created in the CREATE DATABASE section, we type,

DROP DATABASE HOLIDAYS;

Please note that any table that is still in the database will also disappear once the database is dropped.

Frequently Asked Questions

Q: What happens when you DROP a database in SQL?
A: DROP DATABASE permanently deletes the entire database along with all tables, data, indexes, views, and other objects stored within it. This action cannot be undone.

Q: Can you recover a dropped database?
A: No, DROP DATABASE is irreversible without a prior backup. Always ensure you have a current backup before executing DROP DATABASE in a production environment.

Q: Do you need special permissions to DROP a database?
A: Yes. Typically you need DROP or DBA-level privileges to drop a database. Regular users do not have this permission by default.

Q: What is the difference between DROP DATABASE and DROP TABLE?
A: DROP TABLE removes a single table. DROP DATABASE removes the entire database including all tables and data within it.

Next: SQL GRANT

This page was last updated on March 19, 2026.




Copyright © 2026   1keydata.com   All Rights Reserved     Privacy Policy     About   Contact