SQL DROP DATABASE Examples
Let’s look at some examples of the DROP DATABASE statement in SQL.
First, let’s create a database on which we will run the query.
CREATE DATABASE w3wiki;
Now if we look at the list of databases in our system, we can find the “w3wiki” database.
Query:
SHOW DATABASES;
Now we will use the DROP DATABASE command, to delete the database ‘w3wiki’.
Query
DROP DATABASE w3wiki;
Output
SQL DROP DATABASE
SQL DROP DATABASE statement deletes an existing database from the system, and once deleted, users can not retrieve that database.
The DROP DATABASE command in SQL deletes the database along with its data, like tables, views, indexes, constraints, and properties like permissions and schemas.
Contact Us