DROP DATABASE

Overview

Deletes the given database with all its tables and data.

USAGE

Common Syntax:

DROP {DATABASE | SCHEMA} [IF EXISTS] <db_name>

DETAILS

The DROP DATABASE statement irreversibly deletes the database. All tables and data are removed. A dropped database can only be recovered by restoring a backup.

SYNONYMS

SCHEMA

PARAMETERS

SKYSQL

PRIVILEGES

EXAMPLES

DROP DATABASE

To delete a database:

DROP DATABASE db1;

IF EXISTS

By default, if you try to delete a database that does not exist, an error is raised.

To prevent an error when the specified database is not present, add the IF EXISTS clause:

DROP DATABASE IF EXISTS db1;

If the specified database exists, it will be deleted. If the specified database does not exist, the query does not raise an error.

ERROR HANDLING

FEATURE INTERACTION

RESPONSES

DIAGNOSIS

ISO 9075:2016

CHANGE HISTORY

Release Series

History

23.09

  • Present starting in MariaDB Xpand 23.09.1.

6.1

  • Present starting in MariaDB Xpand 6.1.0.

6.0

  • Present starting in MariaDB Xpand 6.0.3.

5.3

  • Present starting in MariaDB Xpand 5.3.13.

Release Series

History

6.0

  • Present starting in MariaDB Xpand 6.0.3.

5.3

  • Present starting in MariaDB Xpand 5.3.13.

Release Series

History

6.1

  • Present starting in MariaDB Xpand 6.1.0.

EXTERNAL REFERENCES