# DROP DATABASE

## Syntax <a href="#synopsis" id="synopsis"></a>

```sql
DROP DATABASE database_name;
```

## Description <a href="#description" id="description"></a>

Drops an existing [database](/overview/core-concepts/databases.md). Only the database owner can execute this.

{% hint style="info" %}
**Note** You cannot drop a database if it contains any non-empty schemas.
{% endhint %}

{% hint style="warning" %}
**Important** `DROP DATABASE` cannot be undone. Use it with care!
{% endhint %}

If your current database is dropped, you must set a new database for the ongoing sessions. See [USE](/reference/sql-syntax/command/use.md).

### Arguments

#### database\_name

The name of the database to drop. If the name is case-sensitive, you must wrap it in double quotes; otherwise, the system uses the lower case name.

## Examples <a href="#example" id="example"></a>

#### Drop a database

The following shows how to drop the database named `DemoDB`:

```sh
db.public/<no-store># LIST DATABASES;
+------------+-------------+------------+-------------------------------+
|  Name      |  Is Default |  Owner     |  Created At                   |
+============+=============+============+===============================+
| mydb       | true        | sysadmin   | 2023-08-09 17:14:46 +0000 UTC |
+------------+-------------+------------+-------------------------------+
| DemoDB     | false       | sysadmin   | 2024-07-02 16:24:11 +0000 UTC |
+------------+-------------+------------+-------------------------------+
db.public/<no-store># DROP DATABASE "DemoDB";
db.public/<no-store># LIST DATABASES;
+------------+-------------+------------+-------------------------------+
|  Name      |  Is Default |  Owner     |  Created At                   |
+============+=============+============+===============================+
| mydb       | true        | sysadmin   | 2023-08-09 17:14:46 +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/ddl/drop-database.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.
