All Products
Search
Document Center

PolarDB:DROP DATABASE

Last Updated:Jun 05, 2024

You can use the DROP DATABASE statement to delete a database.

Syntax

drop_database_stmt:
    DROP DATABASE [IF EXISTS] database_name;

Parameters

Parameter

Description

IF EXISTS

This parameter is used to mitigate errors that occur when you delete a database that does not exist.

database_name

The name of the database that you want to delete.

Examples

Use the following statements to delete a database that is named test:

drop database customer;
Query OK, 0 rows affected (0.03 sec)

drop database if exists customer;
Query OK, 0 rows affected, 1 warning (0.00 sec)