SHOW-DATABASES
Name
SHOW DATABASES
Description
This statement is used to display the currently visible db
grammar:
1. SHOW DATABASES [FROM catalog] [filter expr];
illustrate:
SHOW DATABASESwill get all database names from current catalog.SHOW DATABASES FROM catalogwill all database names from the catalog named ‘catalog’.SHOW DATABASES filter_exprwill get filtered database names from current catalog.SHOW DATABASES FROM catalog filter_expris not support yet.
Example
- Display all the database names from current catalog.
1. SHOW DATABASES;
1. +--------------------+
2. | Database |
3. +--------------------+
4. | test |
5. | information_schema |
6. +--------------------+
2. Display all database names from the catalog named ‘hms_catalog’.
1. SHOW DATABASES from hms_catalog;
1. +---------------+
2. | Database |
3. +---------------+
4. | default |
5. | tpch |
6. +---------------+
3. Display the filtered database names from current catalog with the expr ‘like’.
1. SHOW DATABASES like 'infor%';
1. +--------------------+
2. | Database |
3. +--------------------+
4. | information_schema |
5. +--------------------+
Keywords
1. SHOW, DATABASES
