Overview

CREATE SCHEMA [ IF NOT EXISTS ] schema_name
[ WITH ( property_name = expression [, ...] ) ]

Description

Creates a schema. A schema is a container that holds tables, views, and other database objects.

  • Use the IF NOT EXISTS clause to suppress the exception that is thrown when the schema to be created already exists.
  • Use the WITH clause to set properties for the new schema. To list all available schema properties, run the following statement:
SELECT * FROM system.metadata.schema_properties;

Examples

CREATE SCHEMA web;
CREATE SCHEMA hive.sales;
CREATE SCHEMA IF NOT EXISTS traffic;