A schema contains tables, views, and functions. You create schemas inside catalogs .
Requirements
You must have the USE CATALOG and CREATE SCHEMA data permissions 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.
All users have the USE CATALOG permission on the main catalog by default.
Your Databricks account must be on the Premium plan or above.
You must have a Unity Catalog metastore linked to the workspace where you perform the schema creation.
The compute resource that you use to run the notebook or Databricks SQL to create the catalog must be using a Unity Catalog compliant access mode.
Create a schema
To create a schema (database), you can use Catalog Explorer or SQL commands.
Data Explorer
SQL
Python
R
Scala
Log in to a workspace that is linked to the metastore.
Click Catalog icon Catalog.
In the Catalog pane on the left, click the catalog you want to create the schema in.
In the detail pane, click Create database.
Give the schema a name and add any comment that would help users understand the purpose of the schema.
(Optional) Specify the location where data for managed tables in the schema will be stored.
Specify a location here only if you do not want managed tables in this schema to be stored in the default root storage location that was configured for the metastore or the managed storage location specified for the catalog (if any). See Create a Unity Catalog metastore.
The path that you specify must be defined in an external location configuration, and you must have the CREATE MANAGED STORAGE privilege on that external location. You can also use a subpath of that path. See Manage external locations and storage credentials.
Click Create.
Assign permissions for your catalog. See Unity Catalog privileges and securable objects.
Click Save.
You can also create a schema by using the Databricks Terraform provider and databricks_schema. You can retrieve a list of schema IDs by using databricks_schemas.