See Also
You are here: SQL Reference > Data Definition > CREATE DATABASE
ContentsIndexHome
PreviousUpNext
CREATE DATABASE
CREATE DATABASE

 

Syntax

CREATE DATABASE [IF NOT EXISTS] database_name [COLLATE codepage_number]

 

Description 

Creates a new, empty database named database_name in the current cluster. If IF NOT EXISTS is specified, no error will be raised if the database already exists. 

If COLLATE is specified, codepage_number specifies the codepage of the locale used for the new database. This is used for:

  • Sorting text-based partition columns in tables
  • String function operations

 

Code pages 

Supported code pages:

Number 
Name 
1250 
Eastern European/Latin (default) 
1251 
Cyrillic 

 

Examples 

Create a database with a Cyrillic codepage

CREATE DATABASE example1251 CODEPAGE 1251;

Ensure a database exists without causing an error

CREATE DATABASE IF NOT EXISTS example;

 

 

Related