So another thing to know about the insert command is that you can use it to bulk insert data so we can
insert ten different users at once or we can eventually, once we get to it, we can update ten different
users at once or delete ten or whatever it is.
But for insert, the way that it works is that rather than just giving one set of values like Charlie,
who is ten.
We just use a comma separated list, so we tack on a comma and then we add another one.
Sadie, who's three and then comma lazy bear, who is one.
A note about the common placement does not matter.
You'll see it.
I think what's more logical is actually to put it here at the end of the line.
But often what you see is here, I think it makes it easier for you to just visually break things up
and to see, here's a new line and here's a new line, but really just a matter of preference.
So don't pay too much attention to that.
Don't pay any attention to that.
Actually, what's important is that we have a list and we can multiple insert all at once, so let's
try it.
So we have our cat's table with Blue and Draco.
We will do an insert into cat and we'll do name followed by age.
Now we have values and our first pair or first set of values will be, Oh, boy.
This is the hardest part of teaching this stuff.
Coming up with the fake data, let's say peanut.
And Peanut is too.
And comma.
You could have put the comma there.
It doesn't matter.
Let's say the next one will be called butter.
Who is four?
Yes, I am looking at a thing of peanut butter in my kitchen right now.
So that's where that comes from.
And lastly, let's do.
Sure.
Jelly.
Who is seven?
Just like that, we need our semicolon to end it.
Now we get something slightly new.
Query OC three rows affected.
Awesome.
So to check our work we can just do select star from cats again and I should be consistent.
It doesn't matter, but I'll capitalize it from now.
We have Blue Draco which were there before.
Peanut butter and jelly.
That turned out nicely.
And we inserted them all with one command.
So later on in the course, when we start working with some more complicated data, what I'll actually
do is give you a file that has an insert statement that will insert, let's say, 20 different items
into a database, 20 rows, and you'll be able to run that one line and get kind of starter data that
you can use it.
It'll be an easy way to populate your database with data without having to do it manually 20 times.
Okay.
So that's all there is to multiple inserts.