SQL - DROP or DELETE Database

The SQL DROP DATABASE statement is used to drop an existing database in SQL schema.

If you want to delete or drop an existing database in a SQL schema, you can use SQL DROP DATABASE

Let's see the syntax of SQL DROP DATABASE:

DROP DATABASE DatabaseName;

Example:

If you want to delete an existing database , then DROP DATABASE statement would be as follows:


SQL> DROP DATABASE DB;  

				

NOTE: Be careful before using this operation because by deleting an existing database would result in loss of complete information stored in the database.

Make sure you have admin privilege before dropping any database. Once a database is dropped, you can check it in the list of databases as follows:

SQL> SHOW DATABASES;

+--------------------+

| Database           |

+--------------------+

| JAVATUTORIALPOINTS |

| UISTYLER           |

| mysql              |

| test               |

+--------------------+

4 rows in set (0.00 sec)