You can execute the DROP DATABASE statement to delete a database. This topic describes how to use the DROP DATABASE statement.
- Only a superuser of a database or the database owner configured by a superuser can execute this statement to delete the database.
- When you delete a database, all objects in the database are deleted.
- After a database is deleted, you can no longer connect to it.
DROP DATABASE [ IF EXISTS ] db_name;
In the following example, a database named mydb is deleted:
DROP DATABASE mydb;