SHOW TABLES

Shows the list of tables in the currently selected database, or in another database if db_name is specified.

Syntax

SHOW [FULL] [TEMPORARY] TABLES [{FROM | IN} db_name]
[[EXTENDED] LIKE pattern | WHERE TABLE_TYPE {= | !=} {'VIEW' | 'BASE_TABLE'}]

Remarks

  • db_name is the name of a MemSQL database. If db_name is not specified, then a database must be currently selected (see USE ).\
  • The SHOW TEMPORARY TABLES command run on the child or master aggregator displays only the temporary tables. If this command is run on the leaves, it displays both the temporary tables and global temporary tables.
  • The SHOW TABLES command (without the TEMPORARY option) run on the child or master aggregator displays the global temporary tables and normal tables, except the temporary tables.
  • If you specify a table type, you must also use the FULL keyword.
  • This command can be run on any MemSQL node (see Node Requirements for MemSQL Commands).

Example

Suppose a global temporary table globtemp and a temporary table temptab exists in the database, along with few normal tables. Run the following commands on the master aggregator to view the tables:

SHOW TABLES;
****
+--------------+
| Tables_in_db |
+--------------+
| globtemp     |
| customers    |
| orders       |
+--------------+
SHOW TEMPORARY TABLES;
****
+--------------+------------+------------+
| Tables_in_db | aggregator | connection |
+--------------+------------+------------+
| temptab      |          1 |          5 |
+--------------+------------+------------+