Let's walk through the updating portion of this challenge.
The first piece is to update all of the polo shirts so that their size is L for large.
So as always, I like to select my target rows first.
So select star from shirts and then I'll do something like wear article is polo shirt, I believe is
polo space shirt.
And there we are.
We have three of them.
So what I want to do is change their size to L.
So instead of selecting, of course, I'm going to do an update.
Update Shirt's set and then shirt size equals L wear article equals polo shirt.
Let's see if that works.
It says three rows changed.
Let's go back and select all of them.
And now we see.
Oh, great, that looks good.
I mean, I guess you could verify we didn't somehow change every single shirt to have size L.
We still got a lot of smalls in there and mediums.
So that's our first query.
The next one is to update the shirt that was last worn 15 days ago and changed the last 1 to 0.
So once again, I like to start selecting select start from shirts where last worn equals 15.
Make sure that's what we're supposed to do and change.
Last worn to zero.
We wore it today.
I guess it's a blue medium tank top.
All right, so instead of selecting star from shirts, same thing, We're going to remove that first
part of the query and change it to an update.
Update Shirts set.
And then last one equals zero.
Where last one was 15.
Let's go back and select it.
And.
Well, we can't because my query is still looking for last one of 15.
Let's just select start from shirts.
So that one had an ID of eight.
Look for that idea of eight and last one is now zero.
All right.
And I think this is our final piece.
It is.
Update all the white shirts to have a size of extra small and color to off white.
Same process.
Select star from shirts where color equals white.
And there's two of them.
And we need to change their size to extra small.
And at the same time, I don't want to do two separate queries.
I want to do an update to their shirt size or rather to their color to be off white.
So update shirts sets color to be off.
I'll match it off space white comma if I want a second thing that we're updating, we're going to update
shirt size to be X.
S, make sure that's correct, too.
All right.
And I've got an extra shirts in here.
I don't need that.
And that was from when I had my select.
So update shirts set color to off white and shirt size extra small where color is currently white.
Great.
Let's go ahead and select star from shirts.
And we had one and seven.
One is now off white extra small.
Seven is now off.
White.
Extra small.
Great.