--- title: "CREATE SCHEMA" description: "`CREATE SCHEMA` creates a new schema." menu: main: parent: 'commands' --- `CREATE SCHEMA` creates a new schema. ## Conceptual framework Materialize mimics SQL standard's namespace hierarchy, which is: - Databases (highest level) - Schemas - Tables, views, sources - Columns (lowest level) Each layer in the hierarchy can contain elements directly beneath it. In this instance, schemas can contain tables, views, and sources. For more information, see [Namespaces](../namespaces). ## Syntax {{< diagram "create-schema.svg" >}} Field | Use ------|----- **IF NOT EXISTS** | If specified, _do not_ generate an error if a schema of the same name already exists.

If _not_ specified, throw an error if a schema of the same name already exists. _(Default)_ _schema_name_ | A name for the schema.

You can specify the database for the schema with a preceding `database_name.schema_name`, e.g. `my_db.my_schema`, otherwise the schema is created in the current database. ## Examples ```mzsql CREATE SCHEMA my_db.my_schema; ``` ```mzsql SHOW SCHEMAS FROM my_db; ``` ```nofmt public my_schema ``` ## Privileges The privileges required to execute this statement are: {{< include-md file="shared-content/sql-command-privileges/create-schema.md" >}} ## Related pages - [`DROP DATABASE`](../drop-database) - [`SHOW DATABASES`](../show-databases)