# LIST SCHEMAS

## Syntax

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

## Description

This provides a list of [schemas](/overview/core-concepts/databases.md#_schema) in the current [database](/overview/core-concepts/databases.md) 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 |
+--------+-------------+----------+-------------------------------+
```


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.deltastream.io/reference/sql-syntax/command/list-schemas.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
