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:

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 schema. Catalog Explorer shows this value as the schema Description. See Add comments to data and AI assets.

CREATED

TIMESTAMP

No

No

Timestamp when the schema was created.

CREATED_BY

STRING

No

No

Principal which created the schema.

LAST_ALTERED

TIMESTAMP

No

No

Timestamp when the schema definition was last altered in any way.

LAST_ALTERED_BY

STRING

No

No

Principal which last altered the schema.

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 schema. Catalog Explorer shows this value as the schema Description. See Add comments to data and AI assets.

CREATED

TIMESTAMP

No

No

Timestamp when the schema was created.

CREATED_BY

STRING

No

No

Principal which created the schema.

LAST_ALTERED

TIMESTAMP

No

No

Timestamp when the schema definition was last altered in any way.

LAST_ALTERED_BY

STRING

No

No

Principal which last altered the schema.

Constraints​

The following constraints apply to the SCHEMATA 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.

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​

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