# 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 SingleStore database. If `db_name` is not specified, then a database must be currently selected (see [USE](https://docs.singlestore.com/db/v9.1/reference/sql-reference/data-manipulation-language-dml/use.md) ).
* The `SHOW TABLES` command (without the `TEMPORARY` option) run on the child or master aggregator displays the global temporary tables and normal tables, but not the temporary tables.
* `SHOW TEMPORARY TABLES` will show temporary tables but not global temporary tables.
* If you specify a table type, you must also use the `FULL` keyword.
* This command can be run on any SingleStore node (see [Node Requirements for SingleStore Commands](https://docs.singlestore.com/db/v9.1/reference/sql-reference/cluster-management-commands.md)).
* See the [Permission Matrix](https://docs.singlestore.com/db/v9.1/reference/sql-reference/security-management-commands/permissions-matrix.md) for the required permission.

## Examples

## Example 1

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:

```sql

SHOW TABLES;

```

```output

+---------------+
| Tables_in_db1 |
+---------------+
| allviews      |
| circle        |
| globtemp      |
| product       |
| reading       |
| source        |
| stock         |
| stockN        |
+---------------+

```

```sql

SHOW TEMPORARY TABLES;

```

```output

+---------------+------------+------------+
| Tables_in_db1 | aggregator | connection |
+---------------+------------+------------+
| temptab       |          1 |          5 |
+---------------+------------+------------+

```

## Example 2

```sql

SHOW TABLES EXTENDED;

```

```output

+---------------+------------------------+-------------+-------------------+
| Tables_in_db1 | Table_type             | distributed | Storage_type      |
+---------------+------------------------+-------------+-------------------+
| allviews      | BASE TABLE             |           1 | INMEMORY_ROWSTORE |
| circle        | BASE TABLE             |           1 | INMEMORY_ROWSTORE |
| globtemp      | GLOBAL TEMPORARY TABLE |           1 | INMEMORY_ROWSTORE |
| product       | BASE TABLE             |           1 | INMEMORY_ROWSTORE |
| reading       | BASE TABLE             |           1 | INMEMORY_ROWSTORE |
| source        | BASE TABLE             |           1 | INMEMORY_ROWSTORE |
| stock         | BASE TABLE             |           1 | INMEMORY_ROWSTORE |
| stockN        | BASE TABLE             |           1 | INMEMORY_ROWSTORE |
| temptab       | TEMPORARY TABLE        |           1 | INMEMORY_ROWSTORE |
+---------------+------------------------+-------------+-------------------+

```

## Example 3

```sql

SHOW TABLES LIKE 's%';

```

```output

+--------------------+
| Tables_in_db1 (s%) |
+--------------------+
| source             |
| stock              |
| stockN             |
+--------------------+

```

## Example 4

```sql

SHOW FULL TABLES WHERE TABLE_TYPE = 'BASE TABLE';

```

```output

+---------------+------------+
| Tables_in_db1 | Table_type |
+---------------+------------+
| allviews      | BASE TABLE |
| circle        | BASE TABLE |
| product       | BASE TABLE |
| reading       | BASE TABLE |
| source        | BASE TABLE |
| stock         | BASE TABLE |
| stockN        | BASE TABLE |
+---------------+------------+

```

***

Modified at: April 26, 2023

Source: [/db/v9.1/reference/sql-reference/show-commands/show-tables/](https://docs.singlestore.com/db/v9.1/reference/sql-reference/show-commands/show-tables/)

(An index of the documentation is available at /llms.txt)
