tencent cloud

DROP DATABASE
Last updated: 2024-08-07 17:11:45
DROP DATABASE
Last updated: 2024-08-07 17:11:45

Description

Supported engines: Presto and SparkSQL
Purpose: Delete specified database.

Statement

DROP {DATABASE | SCHEMA} [IF EXISTS] database_name [RESTRICT | CASCADE]

Parameter

DATABASE|SCHEMA: Specify the database or schema.
database_name: Database name
RESTRICT: The database is not deleted if it contains tables. If not specified, the RESTRICT mode is used by default.
CASCADE: All databases and tables are deleted forcibly.

Example

-- Drop the database and it's tables
DROP DATABASE test CASCADE;

-- Drop the database using IF EXISTS
DROP DATABASE IF EXISTS test;



Was this page helpful?
You can also Contact Sales or Submit a Ticket for help.
Yes
No

Feedback