2020-04-03 13:23:32 +00:00
---
toc_priority: 38
toc_title: SHOW
---
2020-03-20 10:10:48 +00:00
# SHOW Queries {#show-queries}
2019-09-27 15:44:36 +00:00
2020-03-20 10:10:48 +00:00
## SHOW CREATE TABLE {#show-create-table}
2019-09-27 15:44:36 +00:00
2020-03-20 10:10:48 +00:00
``` sql
2019-11-13 15:50:09 +00:00
SHOW CREATE [TEMPORARY] [TABLE|DICTIONARY] [db.]table [INTO OUTFILE filename] [FORMAT format]
2019-09-27 15:44:36 +00:00
```
2020-03-20 10:10:48 +00:00
Returns a single `String` -type ‘ statement’ column, which contains a single value – the `CREATE` query used for creating the specified object.
2019-09-27 15:44:36 +00:00
2020-03-18 18:43:51 +00:00
## SHOW DATABASES {#show-databases}
2019-09-27 15:44:36 +00:00
2020-03-20 10:10:48 +00:00
``` sql
2019-09-27 15:44:36 +00:00
SHOW DATABASES [INTO OUTFILE filename] [FORMAT format]
```
Prints a list of all databases.
This query is identical to `SELECT name FROM system.databases [INTO OUTFILE filename] [FORMAT format]` .
2020-03-20 10:10:48 +00:00
## SHOW PROCESSLIST {#show-processlist}
2019-09-27 15:44:36 +00:00
2020-03-20 10:10:48 +00:00
``` sql
2019-09-27 15:44:36 +00:00
SHOW PROCESSLIST [INTO OUTFILE filename] [FORMAT format]
```
2020-04-03 13:23:32 +00:00
Outputs the content of the [system.processes ](../../operations/system_tables.md#system_tables-processes ) table, that contains a list of queries that is being processed at the moment, excepting `SHOW PROCESSLIST` queries.
2019-09-27 15:44:36 +00:00
2019-11-01 14:20:28 +00:00
The `SELECT * FROM system.processes` query returns data about all the current queries.
2019-09-27 15:44:36 +00:00
Tip (execute in the console):
2020-03-20 10:10:48 +00:00
``` bash
2019-09-27 15:44:36 +00:00
$ watch -n1 "clickhouse-client --query='SHOW PROCESSLIST'"
```
2020-03-20 10:10:48 +00:00
## SHOW TABLES {#show-tables}
2019-09-27 15:44:36 +00:00
Displays a list of tables.
2020-03-20 10:10:48 +00:00
``` sql
2020-02-12 01:23:33 +00:00
SHOW [TEMPORARY] TABLES [{FROM | IN} < db > ] [LIKE '< pattern > ' | WHERE expr] [LIMIT < N > ] [INTO OUTFILE < filename > ] [FORMAT < format > ]
2019-09-27 15:44:36 +00:00
```
If the `FROM` clause is not specified, the query returns the list of tables from the current database.
2019-11-01 14:20:28 +00:00
You can get the same results as the `SHOW TABLES` query in the following way:
2019-09-27 15:44:36 +00:00
2020-03-20 10:10:48 +00:00
``` sql
2019-09-27 15:44:36 +00:00
SELECT name FROM system.tables WHERE database = < db > [AND name LIKE < pattern > ] [LIMIT < N > ] [INTO OUTFILE < filename > ] [FORMAT < format > ]
```
**Example**
The following query selects the first two rows from the list of tables in the `system` database, whose names contain `co` .
2020-03-20 10:10:48 +00:00
``` sql
2019-09-27 15:44:36 +00:00
SHOW TABLES FROM system LIKE '%co%' LIMIT 2
```
2020-03-20 10:10:48 +00:00
``` text
2019-09-27 15:44:36 +00:00
┌─name───────────────────────────┐
│ aggregate_function_combinators │
│ collations │
└────────────────────────────────┘
```
2019-11-13 15:50:09 +00:00
2020-03-20 10:10:48 +00:00
## SHOW DICTIONARIES {#show-dictionaries}
2019-11-13 15:50:09 +00:00
2020-04-03 13:23:32 +00:00
Displays a list of [external dictionaries ](../../sql_reference/dictionaries/external_dictionaries/external_dicts.md ).
2019-11-13 15:50:09 +00:00
2020-03-20 10:10:48 +00:00
``` sql
2019-11-13 15:50:09 +00:00
SHOW DICTIONARIES [FROM < db > ] [LIKE '< pattern > '] [LIMIT < N > ] [INTO OUTFILE < filename > ] [FORMAT < format > ]
```
If the `FROM` clause is not specified, the query returns the list of dictionaries from the current database.
You can get the same results as the `SHOW DICTIONARIES` query in the following way:
2020-03-20 10:10:48 +00:00
``` sql
2019-11-13 15:50:09 +00:00
SELECT name FROM system.dictionaries WHERE database = < db > [AND name LIKE < pattern > ] [LIMIT < N > ] [INTO OUTFILE < filename > ] [FORMAT < format > ]
```
**Example**
2020-02-20 06:31:06 +00:00
The following query selects the first two rows from the list of tables in the `system` database, whose names contain `reg` .
2019-11-13 15:50:09 +00:00
2020-03-20 10:10:48 +00:00
``` sql
2019-11-13 15:50:09 +00:00
SHOW DICTIONARIES FROM db LIKE '%reg%' LIMIT 2
```
2020-03-20 10:10:48 +00:00
``` text
2019-11-13 15:50:09 +00:00
┌─name─────────┐
│ regions │
│ region_names │
└──────────────┘
```
2020-02-20 06:31:06 +00:00
[Original article ](https://clickhouse.tech/docs/en/query_language/show/ ) <!--hide-->