This statement is used to delete a database.
DROP DATABASE [IF EXISTS] <db_name> [FORCE];
** 1. <db_name>**
Database Name
** 1. FORCE**
Force deletion without going to the Recycle Bin
The user executing this SQL command must have at least the following permissions:
| Permissions | Object | Notes |
|---|---|---|
| DROP_PRIV | Corresponding database | You need to have delete permission on the corresponding database |
If you execute DROP DATABASE FORCE, the system will not check whether there are any unfinished transactions in the database. The database will be deleted directly and cannot be restored. This operation is generally not recommended.
Setup — create db_test so the DROP example has something to remove:
CREATE DATABASE db_test;
Deleting a Database db_test
DROP DATABASE db_test;