All right.
So the first one is to change Jackson's name to Jack.
So we'll practice what I just talked about running select before you do the update.
So let's just try selecting star from cats where name equals Jackson.
OK so we get Jackson but we want to update his name to be Jack.
So now we do our update cats.
Set name equal to Jack.
That's what we want to change it to.
And where do we want to change it.
We're going to change it where name is currently Jackson.
Now I didn't specify that you had to use wear name ECOs Jackson.
You could also say where everywhere everywhere ID is 7 or where breed is Fink's because we only have
one Spinx right now.
So any of those are valid.
Now if we do or select again we get nothing because there is no cat named Jackson.
If we change it to Jack we get the same cat whose name is now Jack.
Next up change Ringo's breed to British short hair.
So let's do the same thing where we just do a select.
Her name is Ringo.
You can see that currently breed is short hair but we want to get more specific British short hair so
to do that we do an update.
Cats set breed equal to British short hair like that where a name equals Ringo.
And again you can also do cat ID one or where breed is shorthair you could identify this cat however
you like but let's make sure it worked.
So now if I select where name is Ringo we see Breede is now British short hair.
So the last one update both Maine Coons so breed equal Maine Coon and make their ages 12.
So let's just take a look at our current set up in our database can see we have these two main COONTS
Cindy undoubled door.
Cindy is 10 Dumbledores 11 for whatever reason.
We want both of them to be 12.
So let's just select both of them first.
Select star from cats where greed equals man you're just like that.
Perfect.
So we are we are targeting them correctly so we can copy that and then we'll do our update.
Cats set age equal to 12 we don't need quotes where I'm just at and it updates.
Both of them.
So that's really what I was testing here is that you understood that where is not always just going
to return one result.
Whatever is returned will always be updated.
Which is also important to note that if you leave that wear off and I just said Update cat set age 12
that would update every cat which we don't want to do which is why it's always important to select things
first and make sure you know what you're targeting.
Sometimes you might there could be reason to be wanting to update everything in a table like if you
are making a big change or you are migrating something or you realize that you made a big error early
on in your application and you have every piece of data is wrong somehow.
Maybe but most of the time you're being very specific in the changes you're making.
So just to double check we select again.
You can see Cindy and double door and now both 12.
That's all you needed to do.
Perfect.
Next up we're diving into delete.