INFORMATION_SCHEMA.SCHEMATA

Describes schemas within the catalog.

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

Since: Databricks Runtime 10.2

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 table_schema = 'information_schema'
      AND table_name = 'default';
  system