CREATE DATABASE
Description
This statement is used to create databases.
tip
This operation requires the CREATE DATABASE privilege on the target catalog. You can follow the instructions in GRANT to grant this privilege.
Syntax
CREATE DATABASE [IF NOT EXISTS] <db_name>
[PROPERTIES ("key"="value", ...)]
Parameters
db_name
: the name of the database to create. For the naming conventions, see System limits.
PROPERTIES (Optional)
storage_volume
: Specifies the name of the storage volume that is used to store the database in a shared-data cluster.
Examples
-
Create the database
db_test
.CREATE DATABASE db_test;
-
Create the cloud-native database
cloud_db
with the storage volumes3_storage_volume
.CREATE DATABASE cloud_db
PROPERTIES ("storage_volume"="s3_storage_volume");