> ## Documentation Index
> Fetch the complete documentation index at: https://www.propeldata.com/llms.txt
> Use this file to discover all available pages before exploring further.

# SHOW TABLES

> The SHOW TABLES statement reference.

<div />

## Syntax

```sql theme={"system"}
SHOW [FULL] [TEMPORARY] TABLES
[{FROM | IN} <database>]
[[NOT] LIKE | ILIKE '<pattern>']
[LIMIT <N>]
[INTO OUTFILE <filename>]
[FORMAT <format>]
```

## Clauses

### FROM | IN

The FROM or IN clause specifies the database to show tables from. If not specified, tables from the current database are shown.

```sql theme={"system"}
SHOW TABLES FROM taco_shop;
```

### LIKE | ILIKE

The LIKE or ILIKE clause filters table names based on a pattern. ILIKE performs case-insensitive matching.

```sql theme={"system"}
SHOW TABLES LIKE '%taco%';
SHOW TABLES ILIKE '%TACO%';
```

### NOT LIKE | NOT ILIKE

The NOT LIKE or NOT ILIKE clause excludes tables whose names match the specified pattern.

```sql theme={"system"}
SHOW TABLES NOT LIKE '%burrito%';
```

### LIMIT

The LIMIT clause restricts the number of rows in the result set.

```sql theme={"system"}
SHOW TABLES LIMIT 3;
```

### INTO OUTFILE

The INTO OUTFILE clause writes the result to a file.

```sql theme={"system"}
SHOW TABLES INTO OUTFILE 'taco_tables.txt';
```

### FORMAT

The FORMAT clause specifies the output format.

```sql theme={"system"}
SHOW TABLES FORMAT Pretty;
```

## Examples

Show tables containing 'taco' in their names:

```sql theme={"system"}
SHOW TABLES FROM taco_shop LIKE '%taco%'
```

Result:

```bash theme={"system"}
┌─name───────────────┐
│ taco_ingredients   │
│ taco_orders        │
└────────────────────┘
```

Show tables containing 'TACO' in their names (case-insensitive):

```sql theme={"system"}
SHOW TABLES FROM taco_shop ILIKE '%TACO%'
```

Result:

```bash theme={"system"}
┌─name─────┐
│ taco_ingredients  │
│ taco_orders       │
│ TacoSpecials      │
└───────────┘
```

Show tables not containing 'salsa' in their names:

```sql theme={"system"}
SHOW TABLES FROM taco_shop NOT LIKE '%salsa%'
```

Result:

```
┌─name──────────────┐
│ taco_ingredients  │
│ taco_orders       │
│ tortilla_types    │
└───────────────────┘
```

Show the first two tables:

```sql theme={"system"}
SHOW TABLES FROM taco_shop LIMIT 2
```

Result:

```
┌─name──────────────┐
│ taco_ingredients  │
│ taco_orders       │
└───────────────────┘
```

## Notes

* If the FROM clause is not specified, the query returns the list of tables from the current database.
* This statement is equivalent to the following query:
  ```sql theme={"system"}
  SELECT name FROM system.tables
  [WHERE name [NOT] LIKE | ILIKE '<pattern>']
  [LIMIT <N>]
  [INTO OUTFILE <filename>]
  [FORMAT <format>]
  ```
