On this page
SHOW TABLES
Lists the tables, not the views, whose schema and name contain the text you type.
Syntax
SHOW TABLES [[<schema>.]<name>]
Quick start
SHOW TABLES;
Lists every table of the current schema.
SHOW TABLES CUST;
Lists the tables of the current schema whose name contains CUST.
Arguments
| Argument | Required | Values | Default |
|---|---|---|---|
<name> | No | Text the table name contains; % matches any text | Every table |
<schema>. | No | Text the schema name contains, followed by a dot | The current schema |
Examples
SHOW TABLES;
SHOW TABLES CUSTOMER;
SHOW TABLES CUSTOM%;
SHOW TABLES PUBLIC.CUSTOMER;
SHOW TABLES PUB%.CUSTOMER;
SHOW TABLES PUB%.%STOME%;
Details
Matching
The schema part and the name part are each a "contains" search: SHOW TABLES CUSTOMER; finds CUSTOMER, CUSTOMERS and OLD_CUSTOMER alike, without typing %. A % inside the text matches any text. Whether the match is case-sensitive depends on the connected database.
- Without a name, every table is listed.
- Without a schema, only the connection's current schema is searched, not every schema.
What is listed
Only tables: ordinary tables, the temporary tables the database reports (H2 does not report its local temporary tables) and, in a system schema, system tables. Views and materialized views are listed by SHOW VIEWS. Synonyms, sequences, indexes, types and the other objects the database reports are not listed.
Related
- SHOW VIEWS
- DESCR, the columns of one table
- FIND COLUMN
- Exploring a database
Used in these how-tos
Last modified in release 5.5.0.
Found something wrong or unclear on this page? Tell us, with the page address.