So we've seen how to create a database and the natural next step is to see how to delete one.
It's pretty simple.
The command is drop database and then whatever the name of the database is that you're looking to delete.
So we'll come across this term, drop here a couple of times in the course.
It's basically the SQL version of Delete, and we'll be able to use it to drop things other than just
a database.
We'll be able to delete tables, for instance, once we get there.
So let's try it out.
Back in cloud nine when I ran shadow databases.
Here are two that I created.
I'm not going to delete any of the pre-existing ones.
I just don't want to mess with that.
So we will delete both of these though.
Hello, world db and testing DB.
So let's do that now.
Drop Database helloworld db.
Semicolon.
And you can tell that it works first of all because it said query OC.
But then also if I recall, show databases.
This time.
Hello, world Deb is gone.
Let's do the same thing.
Drop database for testing DB.
This time I'm going to leave off a semicolon.
Not because it's a good idea, but just to remind you that your code will not execute until you add
that in there.
It doesn't matter that it's on a separate line.
We'll be writing multi line queries just a little bit.
What does matter is that it's there at all.
It's what indicates that you're done and that it should run.
So.
We can just double check that it worked.
Now our testing DB has gone as well, so that's all there is to dropping a database.
Pretty straightforward command.