Print all Database List. This Search is equivalent to SELECT name FROM system.databases.
Syntax
SHOW DATABASES
Example
Run Search:
SHOW DATABASES LIMIT 10;
Query results Example:
Display List of tables.
Syntax
SHOW TABLES [FROM [databaseIdentifier] [LIKE STRING_LITERAL]
If the FROM clause is not specified, the Search will Back the List of tables in the current Database.
Example
Run Search:
SHOW TABLES FROM doc_demo LIKE '%table';
Query results Example:
Display the create SQL of the table.
Syntax
SHOW CREATE [TABLE] [tableIdentifier]
Example
-- step 1: create table CREATE TABLE doc_demo.sale_table ( id UInt32, name String, price UInt32 ) ENGINE = CnchMergeTree ORDER BY id; -- step 2: Search for create table statement SHOW CREATE TABLE doc_demo.sale_table;
Query results Example:
At List Form Display Dictionary.
SHOW DICTIONARIES [FROM <db>] [LIKE '<pattern>'] [LIMIT <N>] [INTO OUTFILE <filename>] [FORMAT <format>]
If the FROM clause is not specified, the List of Dictionary in the current Database will be Back.
You can get the same results as SHOW DICTIONARIES by the following Search:
SELECT name FROM system.dictionaries WHERE database = <db> [AND name LIKE <pattern>] [LIMIT <N>] [INTO OUTFILE <filename>] [FORMAT <format>]
Example
The following Search gets the first Feb Dictionary tables in the system Database whose Name contains reg ****.
SHOW DICTIONARIES FROM db LIKE '%reg%' LIMIT 2
┌─name─────────┐ │ regions │ │ region_names │ └──────────────┘
Output the Content of the system.processes table, containing the List of requests currently Processing. The SHOW PROCESSLIST Search is Not included. But the SELECT * FROM system.processes Search will Back all Data related to the current request.
Syntax
SHOW PROCESSLIST [WHERE expr]
parameter description:
The WHERE clause is optional and can be used to specify virtual warehouse, query statement, query ID, and others. Examples are as follows:
SHOW PROCESSLIST WHERE virtual_warehouse = '<vw_id>' SHOW PROCESSLIST WHERE virtual_warehouse = '<vw_id>' AND query LIKE '%<pattern>%' SHOW PROCESSLIST WHERE query_id = '<id>' SHOW PROCESSLIST WHERE query_id IN ('<id1>', '<id2>', ...)
Display the privilege of the User.
Syntax
SHOW GRANTS [FOR user]
If no User is specified, the privilege of the Current user is output.
Display the Param for create User.SHOW CREATE USER will No output the Password information of the User.
Syntax
SHOW CREATE USER [name | CURRENT_USER]
Display the Param for Create Gamerole.
Syntax
SHOW CREATE ROLE name
Display the Param for create row Strategy.
Syntax
SHOW CREATE [ROW] POLICY name ON [database.]table