The next thing we need to know about tables is how to get rid of them.
How do we delete a table?
Well, we use a drop table command.
Remember, there was drop database that drops.
An entire database will drop table just drops a single table.
But you still need to be very careful with it because if your table has a lot of information in it,
you can lose all of that.
It doesn't stop you.
It doesn't ask, Are you sure it's just going to drop that table?
So our tables right now are empty, right?
If we do show tables, both of them are empty.
That's not proof that they're empty.
But we know they're empty.
If I want to drop one of them, let's drop cats.
Drop table cats, semicolon.
And that's it.
It didn't give me a heads up or anything.
It's just gone.
If I do show tables now, we only have dogs.
If I refresh the table view over here in one of my graphical user interfaces, we only see dogs.
Same thing here.
If I refresh, we only see dogs inside of pet shop, if you can see that at all.
It's so tiny.
Now another way of deleting a table from one within one of these user interfaces is to right click.
This is in DB gates, right click on the table.
I can click drop table and then it's going to create this little bit of code for me and then I can run
that code if I want to.
But you'll notice it says drop table inside of there.
I assume on workbench we can do something very similar.
Right there.
Drop table if I want to drop the dogs table.
This will ask me to review the SQL or just click drop now.
I'll just click drop now.
And now that table is gone.
Now, I hope you're not dropping lots of tables all the time, but if you do drop a table, I always
say, Well, I don't always say, but I would always recommend that you take a moment to think about
what's in that in that table.
Maybe once we learn how to view the contents, run that first and then drop a table.
But that's my fault for showing you how to drop a table before we can even check what's in them.
But for now, that's all you need to know.
Drop a table using drop space table and the table name and it is gone.
Gone.
Really gone.
It's not coming back.