SQL DROP DATABASE Statement

In this tutorial, we'll learn about deleting databases in SQL with examples.

In SQL, DROP DATABASE is used to delete the database in our Database Management System. For example,

DROP DATABASE my_db;

Here, the SQL command will delete a database named my_db.

Also make sure you have admin or DROP permission to run this command.

Note: When we delete a database, all tables and records within a database are also deleted.


List all Databases

To verify the drop database, we can run the following command to list the available databases.

SHOW DATABASES;

Here, the SQL command lists all the available databases in the DBMS.


Recommended Reading

Table of Contents

Did you find this article helpful?