Materialize Documentation
s
Join the Community github/materialize

CREATE DATABASE

CREATE DATABASE creates a new database.

Conceptual framework

Materialize mimics SQL standard’s namespace hierarchy, which is:

Each layer in the hierarchy can contain elements directly beneath it. In this instance, databases can contain schemas.

For more information, see Namespaces.

Syntax

CREATE DATABASE IF NOT EXISTS database_name
Field Use
IF NOT EXISTS If specified, do not generate an error if a database of the same name already exists.

If not specified, throw an error if a database of the same name already exists. (Default)
database_name A name for the database.

Details

For details about databases, see Namespaces: Database details.

Examples

CREATE DATABASE IF NOT EXISTS my_db;
SHOW DATABASES;
materialize
my_db