Equally as simple as the CREATE DATABASE statement, the DROP DATABASE statement will destroy an entire database. This tutorial uses MySQL Workbench.

In this tutorial:

  1. Syntax
  2. Example

Required knowledge:

Syntax

DROP DATABASE `databasename`;

Example

Continuing from the CREATE DATABASE statement tutorial, we will now DROP the database in MySQL Workbench using the following SQL:

DROP DATABASE `dbtest`;

Dropping a database in MySQL Workbench.Dropping a database in MySQL Workbench.
  1. Select the database, dbtest
  2. Select the Query window
  3. Type the query DROP DATABASE dbtest;
  4. Click the Execute button
  5. The Output panel with the results of the statement
  6. The dbtest database has been dropped

References:

  1. W3Schools.com (no date) MySQL DROP DATABASE Statement. Available at: https://www.w3schools.com/mysql/mysql_drop_db.asp (Accessed: 9 June 2024).

By MisterFoxOnline

Mister Fox AKA @MisterFoxOnline is an ICT, IT and CAT Teacher who has just finished training as a Young Engineers instructor. He has a passion for technology and loves to find solutions to problems using the skills he has learned in the course of his IT career.