Skip to main content

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:

PermissionsObjectNotes
DROP_PRIVCorresponding databaseYou 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;