To create a new schema in Snowflake, you can use the **`CREATE SCHEMA`** statement. This command creates a logical container for organizing database objects within the Snowflake database. Here’s the SQL syntax for creating a new schema:
CREATE SCHEMA schema_name;
– **`schema_name`**: The name you want to give to the new schema.
Here’s an example of creating a new schema named **`sales_data`**:
CREATE SCHEMA sales_data;
Once the schema is created, you can use it to organize and manage database objects such as tables, views, functions, and more. For instance, you can create tables within the newly created schema:
CREATE TABLE sales_data.sales (
In this example, a schema named **`sales_data`** is created, and a table named **`sales`** is created within that schema. This helps keep related objects together and improves data organization and management within the Snowflake database.