tencent cloud

All product documents
Data Lake Compute
CREATE DATABASE
Last updated: 2024-08-07 17:10:06
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');



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

Feedback

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 available.

7x24 Phone Support
Hong Kong, China
+852 800 906 020 (Toll Free)
United States
+1 844 606 0804 (Toll Free)
United Kingdom
+44 808 196 4551 (Toll Free)
Canada
+1 888 605 7930 (Toll Free)
Australia
+61 1300 986 386 (Toll Free)
EdgeOne hotline
+852 300 80699
More local hotlines coming soon