tencent cloud

Feedback

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;
    
    
    
    Contact Us

    Contact our sales team or business advisors to help your business.

    Technical Support

    Open a ticket if you're looking for further assistance. Our Ticket is 7x24 avaliable.

    7x24 Phone Support