OK so we've made it to the end.
The final video solution to our spring cleaning extravaganza problem.
Now we need to do.
We've covered creating reading and updating.
Basically inserting selecting an update now we're going to use to.
So the first thing is to delete all old shirts which really just in this case means last worne is 200
Exactly.
So when you do or select star you can see there's two shirts that meet that criteria 7 idea of 7 an
idea of two.
But we're going to delete them based off of last one.
So we always start with our select star from shirts where last worn equals 200 when we get our two shirts
then we can copy this and actually we can copy this entire thing delete from Schertz where last one
is two hundred two rows affected.
Now for us to Nexstar those two are gone.
You can see it goes from one to three and then from six to eight then there we go.
So the next problem is to delete all tank tops.
We've decided take steps to make it look kind of stupid.
So we're going into the tank tops.
So your tastes have changed.
So how many tank tops do we have.
We've got one and two that are left.
So we'll do a select star from Schertz where article equals tank top.
We get to that all we need to do now is delete from Schertz where article equals tank top hit enter.
Now we try and select them.
They're gone.
And if we do a select star from a shirt with NO WHERE clause.
Now we have 1 3 5 6 9 so we've lost our two tank tops.
All we have are T-shirts and polo shirts which leads us to our final exercise here.
So eat all the shirts and I lied it takes me the second to last.
So to delete all the shirts but not the entire table.
It's pretty simple.
We use the SAME WHERE clause which which is to say that we don't have a WHERE clause.
So in this case it returns select star from shirts or turns all shirts.
Well we just replace that delete from Schertz.
I can't spell it correctly with this part.
And Moment of Truth 5 rows affected.
Now and if you select start from Schertz we get nothing.
So sad day not as sad as we need to play to the cats but still sad.
And the last thing is to drop the entire Schertz table.
We're just done with this.
We hated this exercise.
We want to move on.
So drop table shirts now hit enter.
And if I do show tables no tables and if I try and describe Schertz we get an error because there is
no Schertz table to describe and it freaks out.
So we've successfully deleted it.
Now we have an empty database that we don't need anymore and we're done with this.
Congratulations.