SQL DROP DATABASE Syntax – Listed by DBMS

This article lists the SQL DROP DATABASE syntax, as implemented by various database management systems (DBMSs). The syntax is listed exactly as each vendor has listed it on their website. Click on the applicable link to view more detail about the syntax for a particular vendor.

The DBMSs covered are MySQL, SQL Server, PostgreSQL, and Oracle Database.

MySQL

From the MySQL 5.7 Reference Manual:

DROP {DATABASE | SCHEMA} [IF EXISTS] db_name

SQL Server

From the Transact-SQL Reference:

DROP DATABASE { database_name | database_snapshot_name } [ ,...n ] [;]

PostgreSQL

From the PostgreSQL 9.5 Manual:

DROP DATABASE [ IF EXISTS ] name

Oracle Database

From the Oracle Database Online Documentation 12c Release 1 (12.1):

DROP DATABASE ;

SQL Standard

Note that there is no DROP DATABASE statement in the SQL standard (there is no CREATE DATABASE statement either).

The SQL standard leaves it up to vendors to define how a particular implementation will create and drop a database.

Using the GUI

Dropping databases can also be done via the GUI in each of the database management systems, or by using any of the GUI tools available for use with that product.

For example, MySQL Workbench can be used with MySQL.