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

<AgentInstructions>

## Submitting Feedback

If you encounter incorrect, outdated, or confusing documentation on this page, submit feedback:

POST https://docs.firebolt.io/feedback

```json
{
  "path": "/reference-sql/commands/data-definition/drop-database",
  "feedback": "Description of the issue"
}
```

Only submit feedback when you have something specific and actionable to report.

</AgentInstructions>

> Reference and syntax for the DROP DATABASE command.

# DROP DATABASE

Deletes a database.

## Syntax

Deletes the database and all of its objects including tables, views and aggregating indexes.

`DROP DATABASE [IF EXISTS] <database_name>`

## Parameters

| Parameter         | Description                            |
| :---------------- | :------------------------------------- |
| `<database_name>` | The name of the database to be deleted |

## Restrictions

A database cannot be dropped if it is used as a default database for any engine. To check which engines are using a specific database as their default, run the following query:

```sql theme={"theme":{"light":"github-light","dark":"github-dark"}}
SELECT engine_name 
FROM information_schema.engines 
WHERE default_database = 'db_name';
```

If the query returns no results and you expect engines to be using this database, you may not have the necessary permissions to view engine information. Contact your account administrator for assistance.

Before dropping the database, you must change the default database for all affected engines using the [`ALTER ENGINE`](/reference-sql/commands/engines/alter-engine) command.

For more information, see:

* [`information_schema.engines`](/reference-sql/information-schema/engines) - View engine configuration details
* [`ALTER ENGINE`](/reference-sql/commands/engines/alter-engine) - Change engine settings including the default database
