DROP DATABASE
Descriptionβ
This statement is used to delete a database.
Syntaxβ
DROP DATABASE [IF EXISTS] <db_name> [FORCE];
Required parametersβ
** 1. <db_name>
**
Database Name
Optional parametersβ
** 1. FORCE
**
Force deletion without going to the Recycle Bin
Permission Controlβ
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 |
Precautionsβ
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.
Exampleβ
-
Deleting a Database db_test
DROP DATABASE db_test;