Skip to main content

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:

NameData typeNullableStandardDescription
CATALOG_NAMESTRINGNoYesCatalog containing the schema.
SCHEMA_NAMESTRINGNoYesName of the schema.
SCHEMA_OWNERSTRINGNoNoUser or group (principal) that currently owns the schema.
COMMENTSTRINGYesNoAn optional comment that describes the relation.
CREATEDTIMESTAMPNoNoTimestamp when the relation was created.
CREATED_BYSTRINGNoNoPrincipal which created the relation.
LAST_ALTEREDTIMESTAMPNoNoTimestamp when the relation definition was last altered in any way.
LAST_ALTERED_BYSTRINGNoNoPrincipal which last altered the relation.

Constraints

The following constraints apply to the TABLES relation:

ClassNameColumn ListDescription
Primary keySCHEMATA_PKCATALOG_NAME, SCHEMA_NAMEUnique identifier for the schema.
Foreign keySCHEMATA_CATS_FKCATALOG_NAMEReferences CATALOGS.

Examples

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