So we've been looking at the existing built in databases.
It's not very exciting.
Well, this may not be all that exciting either, but this is a step in the right direction.
We're going to learn how to create new databases.
So these will be an empty database.
It's just like an empty bubble that we then will put our database information inside of.
But all that it starts out as is an empty shell that has a name.
So the way that this works, by the way, the syntax that I've written here, any time you see this
in these slides, these angle brackets mean you replace this with your own name so you don't actually
write those brackets.
So create database and then pet store or soap store or dog app.
Now in terms of how you name these, you want to come up with something unique that is obvious.
You're not going to be typing this all that much honestly, compared to the names of the entities inside
the databases.
But it should be an obvious name that makes sense, right?
It should be meaningful.
You technically can put spaces, but it can cause problems.
So I highly recommend against it.
You won't really see anybody put spaces in them, so just don't.
But you can use underscores what we would call snake case or camel casing uppercase letters for each
word.
It doesn't matter.
You just want to come up with a name that makes sense.
Now, in terms of the capitalization here, this also doesn't actually matter, but this is really common
in SQL.
We'll see this all over the place.
Basically, you capitalize all the SQL keywords like create and database that are always the same,
and then that helps it stand out from your content like the name so you don't have to.
I'll show both, but you probably should just to make it easier.
So I'm going to make a new database.
I'll make a couple create database.
I'm going to do it from the command line first in my MySQL Shell create database.
Let's call this, I don't know, pet shop just like that.
Now again, I need the semicolon and if I forget it, that's okay, because my prompt sort of reminds
me, it's waiting.
That's what that arrow means.
It doesn't say my SQL, it's just an arrow again, it's sort of like, okay, what else?
Hurry up, finish.
I'm going to hit semicolon.
Enter.
And it doesn't matter that it was on a separate line.
My SQL doesn't care about how we break up our commands across lines.
So this works and you'll see I get a message query OC one row affected.
And if I now run my show databases command, I can just use the up arrow to cycle through commands I've
run and I'll see I have a pet shop database OC So simple enough, let's just do one more.
I'm going to clear my screen create this time I won't do it uppercase just so you can see it still works.
Create database.
How about a slime store?
We sell slime.
Let's do uppercase here Slime store, and then I'll put my semicolon there.
And if I do show databases and this time I'll do this in all caps as well, just to show you.
We see slime store alongside Pet Shop.
So we have these two empty containers now that eventually shortly we'll put data inside of.
Now let's hop over to the workbench.
I found a way to increase the font.
It's kind of a pain, but what I'm going to do here is show you that first off, on the left side,
I have a list of databases that the workbench knows about and it should know about these databases I
just made, but it doesn't.
I have to tell it to refresh.
So there's a button right here to refresh it.
And now I see Pet Shop and Slime store.
Let me see if I can make this larger.
Well, I just spent like 5 minutes googling.
There's no way to change the interface font size over here, so I'll just have to zoom in in post-production.
But as you can see now, when I refreshed, I have two new databases that are showing up or two.
They're not new.
They were created over here, but their names are showing up Pet shop and slime store.
And I could create a database from within here if I wanted to create database.
I don't know.
What should we call this one?
How about chicken coop?
Just like that.
And then I hit this lightning bolt.
It runs this script, and down here I get a response.
It said, That worked.
One row affected create database chicken coop.
And if I refresh, we now see chicken coop show up here.
I go back to this side.
If I do the same thing, show databases.
We now have chicken coop.
So once again, just confirmation that we're working in the same world, just two different sort of
portals into it.
One is the terminal, the other is this my SQL workbench, which this is really a tiny font.
I got to figure something else out.
Anyway, that is how we create databases.
They're empty shells.
They're a husk of a database.
The next thing we need to do is delete them and learn how to use them.