Skip to playerSkip to main content
  • 6 years ago
Learn how to remove or delete a database from the database management system using SQL statement. Using standard SQL we can create as as well as remove the database from our database management system.

The DROP DATABASE SQL statement is used to remove or delete the database including all the tables and data rows in it. Be careful before deleting the database completely from your database management system because the system does not ask for confirmation.

As soon as you run the SQL DROP DATABASE statement, the system will remove the database, tables and data rows instantly and there is no easy method to recover the lost database.

Here is the SQL statement to delete the database. "DROP databasename;".

First of all lets display all the existing databases using SQL statement, "SHOW DATABASES;" The system displays all the available database.

In previous lecture we created 2 databases called '1234d' and 'my_database'. Lets delete the database '1234d', The SQL statement will be, "DROP DATABASE 1234d;" and we get 'Query OK, 0 rows affected' message Now, if display all the existing databases using SQL statement, "SHOW DATABASES;" the database '1234d' is gone.

Category

📚
Learning

Recommended