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

# DROP SCHEMA

> Use the `DROP SCHEMA` command to remove a schema from a database.

## Syntax

```sql theme={null}
DROP SCHEMA [ IF EXISTS ] [database_name.]schema_name [ CASCADE ];
```

## Parameters

| Parameter or clause  | Description                                                                                                                                                                                                                                                                   |
| :------------------- | :---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| **IF EXISTS** clause | Do not return an error if the specified schema does not exist.                                                                                                                                                                                                                |
| database\_name       | Specify the name of a database to remove the schema in that database. You can use [SHOW DATABASES](/sql/commands/sql-show-databases) to get a list of all available databases. If you don't specify a database, the specified schema in the default database will be removed. |
| schema\_name         | The name of the schema you want to remove. The default schema is public. You can use [SHOW SCHEMAS](/sql/commands/sql-show-schemas) to get a list of all available schemas.                                                                                                   |
| **CASCADE**          | Automatically drops the schema's dependent objects (tables, materialized views, etc.) and any objects that depend on those objects.                                                                                                                                           |

## Examples

This statement removes the `rw_schema` schema from the `rw_db` database:

```sql theme={null}
DROP SCHEMA rw_db.rw_schema;
```

This statement removes the `rw_schema` schema from the `dev` database (default database):

```sql theme={null}
DROP SCHEMA rw_schema;
```

Use this statement to avoid an error if the schema does not exist:

```sql theme={null}
DROP SCHEMA IF EXISTS rw_schema;
```

This statement removes the `rw_schema` schema and everything it contains from the database:

```sql theme={null}
DROP SCHEMA rw_schema CASCADE;
```
