---
title: "DROP DATABASE"
url: "https://docs.yugabyte.com/stable/api/ysql/the-sql-language/statements/ddl_drop_database/"
---

# DROP DATABASE

Use the DROP DATABASE statement to remove a database and all of its associated objects from the system.

## Synopsis

Use the `DROP DATABASE` statement to remove a database and all of its associated objects from the system. This is an irreversible statement. A currently-open connection to the database will be invalidated and then closed as soon as the statement is executed using that connection.

## Syntax

- [![Grammar Icon](/icons/file-lines.svg)Grammar](#grammar-1)
- [![Diagram Icon](/icons/diagram.svg)Diagram](#diagram-1)

```output.ebnf
drop_database ::= DROP DATABASE [ IF EXISTS ] database_name
```

#### drop\_database

DROPDATABASEIFEXISTS[database\_name](/stable/api/ysql/syntax_resources/grammar_diagrams#database-name)

## Semantics

### *drop\_database*

#### DROP DATABASE \[ IF EXISTS ] *database\_name*

Remove a database and all associated objects. All objects that are associated with `database_name` such as tables will be invalidated after the drop statement is completed. All connections to the dropped database would be invalidated and eventually disconnected.

### *database\_name*

Specify the name of the database.

## See also

- [CREATE DATABASE](/stable/api/ysql/the-sql-language/statements/ddl_create_database "CREATE DATABASE")
