Files
doris/docs/en/docs/sql-manual/sql-reference/Show-Statements/SHOW-DATABASES.md
huangzhaowei 04d26ddf22 [feature-wip](multi-catalog)Support use catalog.db and show databases from catalog stmt (#11338)
Support use catalog.db and show databases from catalog stmt.
2022-08-11 09:50:32 +08:00

2.2 KiB

title, language
title language
SHOW-DATABASES en

SHOW-DATABASES

Name

SHOW DATABASES

Description

This statement is used to display the currently visible db

grammar:

SHOW DATABASES [FROM catalog] [filter expr];

illustrate:

  1. SHOW DATABASES will get all database names from current catalog.
  2. SHOW DATABASES FROM catalog will all database names from the catalog named 'catalog'.
  3. SHOW DATABASES filter_expr will get filtered database names from current catalog.
  4. SHOW DATABASES FROM catalog filter_expr is not support yet.

Example

  1. Display all the database names from current catalog.

    SHOW DATABASES;
    

+--------------------+ | Database | +--------------------+ | test | | information_schema | +--------------------+


2. Display all database names from the catalog named 'hms_catalog'.

```sql
SHOW DATABASES from hms_catalog;
+---------------+
| Database      |
+---------------+
| default       |
| tpch          |
+---------------+
  1. Display the filtered database names from current catalog with the expr 'like'.

    SHOW DATABASES like 'infor%';
    

+--------------------+ | Database | +--------------------+ | information_schema | +--------------------+


### Keywords

 SHOW, DATABASES

### Best Practice