tencent cloud

DocumentaçãoData Lake Compute

CREATE DATABASE

Baixar
Modo Foco
Tamanho da Fonte
Última atualização: 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');




Ajuda e Suporte

Esta página foi útil?

comentários