SCHEMATA

Applies to: check marked yes Databricks SQL check marked yes Databricks Runtime 10.4 LTS and above check marked yes Unity Catalog only

INFORMATION_SCHEMA.SCHEMATA describes schemas within the catalog.

The rows returned are limited to the schemas the user has permission to interact with.

Definition

The SCHEMATA relation contains the following columns:

Name Data type Nullable Standard Description
CATALOG_NAME STRING No Yes Catalog containing the schema.
SCHEMA_NAME STRING No Yes Name of the schema.
SCHEMA_OWNER STRING No No User or group (principal) that currently owns the schema.
COMMENT STRING Yes No An optional comment that describes the relation.
CREATED TIMESTAMP No No Timestamp when the relation was created.
CREATED_BY STRING No No Principal which created the relation.
LAST_ALTERED TIMESTAMP No No Timestamp when the relation definition was last altered in any way.
LAST_ALTERED_BY STRING No No Principal which last altered the relation.

Constraints

The following constraints apply to the TABLES relation:

Class Name Column List Description
Primary key SCHEMATA_PK CATALOG_NAME, SCHEMA_NAME Unique identifier for the schema.
Foreign key SCHEMATA_CATS_FK CATALOG_NAME References CATALOGS.

Examples

SELECT schema_owner
  FROM information_schema.schemata
  WHERE schema_name = 'information_schema'
  AND catalog_name = 'main'