# LIST SCHEMAS

## Syntax

```sql
[ LIST | SHOW ] SCHEMAS
[ IN DATABASE database_name ];
```

## Description

This provides a list of [schemas](https://docs.deltastream.io/overview/core-concepts/databases#_schema) in the current [database](https://docs.deltastream.io/overview/core-concepts/databases) or in a specific database. Only schemas with ownership are returned in the list.

Schemas are listed only if the current role has USAGE privileges on the database and schema.

### Arguments

#### IN DATABASE database\_name

Optionally, this lists the schemas in the provided database.

## Examples

#### List schemas in the current database

The following provides a list of schemas in the current `demodb` database:

```sh
demodb.public/demostore# LIST SCHEMAS;
+-----------+-------------+----------+-------------------------------+
|  Name     |  Is Default |  Owner   |  Created At                   |
+===========+=============+==========+===============================+
| public    | false       | sysadmin | 2023-08-09 21:28:40 +0000 UTC |
+-----------+-------------+----------+-------------------------------+
| Analytics | true        | orgadmin | 2024-07-18 16:36:16 +0000 UTC |
+-----------+-------------+----------+-------------------------------+
```

#### List schemas in a specific database

The following provides a list of schemas in the `user_db` database:

```sh
main_db.public/demostore# LIST SCHEMAS IN DATABASE user_db;
+--------+-------------+----------+-------------------------------+
|  Name  |  Is Default |  Owner   |  Created At                   |
+========+=============+==========+===============================+
| public | true        | orgadmin | 2024-06-05 19:41:23 +0000 UTC |
+--------+-------------+----------+-------------------------------+
```
