---
title: Create schemas
description: Learn how to create schemas (databases) in Databricks using both Unity Catalog and the legacy Hive metastore.
canonical_url: https://docs.databricks.com/aws/en/schemas/create-schema
---

# Create schemas

This page shows how to create schemas in Unity Catalog and the legacy Hive metastore.

To learn about schemas in Databricks, including a comparison of schema behavior in Unity Catalog and Hive metastore, see [What are schemas in Databricks?](https://docs.databricks.com/aws/en/schemas/index.md).

> [!NOTE]
>
> `INFORMATION_SCHEMA` is a reserved name. Every Unity Catalog catalog automatically includes a system-provided read-only `INFORMATION_SCHEMA`, so you cannot create a user schema with that name. See [Information schema](https://docs.databricks.com/aws/en/sql/language-manual/sql-ref-information-schema.md).

## Requirements

To create a schema in Unity Catalog:

* You must have a Unity Catalog metastore [linked to the workspace](https://docs.databricks.com/aws/en/data-governance/unity-catalog/create-metastore.md) where you perform the schema creation.
* You must have the `USE CATALOG` and `CREATE SCHEMA` [data permissions](https://docs.databricks.com/aws/en/data-governance/unity-catalog/access-control/privileges-reference.md) on the schema's parent catalog. Either a metastore admin or the owner of the catalog can grant you these privileges. If you are a metastore admin, you can grant these privileges to yourself.
* To specify an optional managed storage location for the tables and volumes in the schema, an external location must be defined in Unity Catalog, and you must have the `CREATE MANAGED STORAGE` privilege on the external location. See [Specify a managed storage location in Unity Catalog](https://docs.databricks.com/aws/en/connect/unity-catalog/cloud-storage/managed-storage.md).
* The cluster that you use to run a notebook to create a schema must use a Unity Catalog-compliant access mode. See [Access modes](https://docs.databricks.com/aws/en/compute/configure.md#access-mode). SQL warehouses always support Unity Catalog.

To create a schema in Hive metastore:

* Permissions required depend on whether you are using table access control. See [Hive metastore privileges and securable objects (legacy)](https://docs.databricks.com/aws/en/data-governance/unity-catalog/access-control/table-acls/object-privileges.md).

## <a id="create-schema" />Create a schema

To create a schema in Unity Catalog, you can use Catalog Explorer or SQL commands. To create a schema in Hive metastore, you must use SQL commands.

### Catalog Explorer

1. Log in to a workspace that is linked to the Unity Catalog metastore.

2. Click ![Data icon.](https://docs.databricks.com/aws/en/images/product-icons/DataIcon.svg) **Catalog**.

3. In the **Catalog** pane on the left, click the catalog you want to create the schema in.

4. Click the **Create schema** button.

   ![Create a schema in Catalog Explorer](https://docs.databricks.com/aws/en/images/catalog-explorer/catalog-explorer-create-schema.png)

5. Give the schema a name and add any comment that would help users understand the purpose of the schema.

6. (Optional) Specify a managed storage location. Requires the `CREATE MANAGED STORAGE` privilege on the target external location. See [Specify a managed storage location in Unity Catalog](https://docs.databricks.com/aws/en/connect/unity-catalog/cloud-storage/managed-storage.md) and [Managed locations for schemas](https://docs.databricks.com/aws/en/schemas/index.md#locations).

7. Click **Create**.

8. Grant privileges on the schema. See [Manage privileges in Unity Catalog](https://docs.databricks.com/aws/en/data-governance/unity-catalog/manage-privileges/index.md).

9. Click **Save**.

### SQL

1. Run the following SQL commands in a notebook or the SQL query editor. Items in square brackets are optional. You can use either `SCHEMA` or `DATABASE`. Replace the placeholder values:

   * `<catalog-name>`: The name of the parent catalog for the schema. If you are creating a schema in Hive metastore and you are in a Unity Catalog-enabled workspace, use `hive_metastore` as the catalog name. If your workspace is not enabled for Unity Catalog, don't specify a catalog at all.
   * `<schema-name>`: A name for the schema.
   * `<location-path>`: Optional path to a managed storage location. Use with `MANAGED LOCATION` for Unity Catalog and with `LOCATION` for Hive metastore. In Unity Catalog, you must have the `CREATE MANAGED STORAGE` privilege on the external location for the path that you specify. See [Specify a managed storage location in Unity Catalog](https://docs.databricks.com/aws/en/connect/unity-catalog/cloud-storage/managed-storage.md) and [Managed locations for schemas](https://docs.databricks.com/aws/en/schemas/index.md#locations).
   * `<comment>`: Optional description or other comment.
   * `<property-key> = <property-value> [ , ... ]`: Optional. Spark SQL properties and values to set for the schema.

   For more detailed parameter descriptions, see [CREATE SCHEMA](https://docs.databricks.com/aws/en/sql/language-manual/sql-ref-syntax-ddl-create-schema.md).

   ```sql
   CREATE { DATABASE | SCHEMA } [ IF NOT EXISTS ] <catalog-name>.<schema-name>
       [ MANAGED LOCATION '<location-path>' | LOCATION '<location-path>']
       [ COMMENT <comment> ]
       [ WITH DBPROPERTIES ( <property-key = property_value [ , ... ]> ) ];
   ```

2. Grant privileges on the schema. For Unity Catalog privileges, see [Manage privileges in Unity Catalog](https://docs.databricks.com/aws/en/data-governance/unity-catalog/manage-privileges/index.md).

You can also create a schema by using the [Databricks Terraform provider](https://docs.databricks.com/aws/en/dev-tools/terraform/index.md) and [databricks\_schema](https://registry.terraform.io/providers/databricks/databricks/latest/docs/resources/schema). You can retrieve a list of schema IDs by using [databricks\_schemas](https://registry.terraform.io/providers/databricks/databricks/latest/docs/data-sources/schemas)

## Next steps

* To learn how to add tables, views, and volumes to your schema, see [Databricks tables](https://docs.databricks.com/aws/en/tables/index.md), [What is a view?](https://docs.databricks.com/aws/en/views/index.md), and [What are Unity Catalog volumes?](https://docs.databricks.com/aws/en/volumes/index.md).
* To learn how to add AI models to your schema, see [Manage model lifecycle in Unity Catalog](https://docs.databricks.com/aws/en/machine-learning/manage-model-lifecycle/index.md).
* To learn how to view, update, and drop existing schemas, see [Manage schemas](https://docs.databricks.com/aws/en/schemas/manage-schema.md).
