A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://docs.databricks.com/aws/en/sql/language-manual/sql-ref-information-schema below:

Information schema | Databricks Documentation

Information schema

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

The INFORMATION_SCHEMA is a SQL standard based schema, provided in every catalog created on Unity Catalog.

Within the information schema, you can find a set of views describing the objects known to the schema's catalog that you are privileged to see. The information schema of the SYSTEM catalog returns information about objects across all catalogs within the metastore. Information schema system tables do not contain metadata about hive_metastore objects.

The purpose of the information schema is to provide a SQL based, self describing API to the metadata.

Entity relationship diagram of the information schema​

The following entity relationship (ER) diagram provides an overview of a subset of information schema views and how they relate to each other.

Information schema views​ Notes​ Examples​

SQL

> SELECT table_name, column_name
FROM information_schema.columns
WHERE data_type = 'DOUBLE'
AND table_schema = 'information_schema';

The following are examples of workflows that use the system level information schema tables.

If you want to view all tables that have been created in the last 24 hours, your query could look like the following.

SQL

> SELECT table_name, table_owner, created_by, last_altered, last_altered_by, table_catalog
FROM system.information_schema.tables
WHERE datediff(now(), last_altered) < 1;

If you want to view how many tables you have in each schema, consider the following example.

SQL

> SELECT table_schema, count(table_name)
FROM system.information_schema.tables
WHERE table_schema = 'tpch'
GROUP BY table_schema
ORDER BY 2 DESC
Related articles​

RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4