All right.
So we saw how we can create databases and destroy them.
So what comes next?
We're going to see how we actually use them.
And I mean that in a very literal sense.
In my SQL, there is a use command.
And what this does is it tells my SQL which database we want to be working with.
So we have potentially ten different databases on one, my SQL Server and we want to search some data
from one of them.
What we need to tell my SQL, which one we want to be using at any given time, and we can switch between
them using the use command that you see right here.
So I'll really quickly show you how it works over in Cloud nine.
So if we create a new database
and we'll just call this one dog walking app and we hit enter, we do show databases.
There it is.
And if I want to use that, all I have to do is type use dog walking app.
And you won't see much except for database changed.
That's a good thing.
But if we wanted to know for sure what database we are currently using, there's another MySQL command
that we can use and that command looks like this select database with parentheses after it.
And what this will do is tell you the currently used database.
So let's try that out.
Back in cloud nine, if I type a select database with those parentheses and a semicolon.
It tells me database is dog walking app.
And if I decided to delete that database, I would use the drop database, dog walking App Command.
It tells me.
Query OC.
I do show databases and it should be gone.
But if I do my select database command.
Pause and think to yourself for a moment.
What database do you think I'll be using right now?
We were using the dog walking app, but then we deleted it.
So now what?
And here's the answer.
Kind of a trick question.
We're not using a database right now, hence the null here.
And we'll be talking a bit more about NULL throughout this course.
But that basically means we're not using any database.
So just to show you one more time, if we switch, let's say I wanted to use one of these pre-existing
ones like the C nine database.
I'm not going to delete that, but if I wanted to, I just use C nine.
And now if I do my select database.
Tells me database is C nine OC.
So that's all there is to using a database and then also this select database command to see your current
database.
Next up, we'll start talking about tables and putting some data in these databases as soon as possible.