tencent cloud

Feedback

CREATE DATABASE

Last updated: 2024-08-07 17:10:06

    Description

    Supported engines: Presto and SparkSQL
    Purpose: Create a database, or specify or change the storage location of a table or partitioned table.

    Statement

    CREATE {DATABASE|SCHEMA} [IF NOT EXISTS] database_name
    [COMMENT 'database_comment']
    [WITH DBPROPERTIES ('property_name' = 'property_value') [, ...]]

    Parameter

    DATABASE|SCHEMA: Specify the database or schema.
    database_name: Database name.
    database_comment: Database comment.
    [WITH DBPROPERTIES ('property_name' = 'property_value') [, ...]]: Configure database parameters using key-value pairs.

    Example

    Create database db only if database with same name doesn't exist.
    CREATE DATABASE IF NOT EXISTS db;
    Create database db only if database with same name doesn't exist with Comment and Database Properties.
    CREATE DATABASE db
    COMMENT 'db1_name'
    WITH DBPROPERTIES('k1' = 'v1','k2' = 'v2');
    
    
    
    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