WEBVTT

00:00.100 --> 00:01.560
OK so we've made it to the end.

00:01.590 --> 00:06.640
The final video solution to our spring cleaning extravaganza problem.

00:06.660 --> 00:07.680
Now we need to do.

00:07.710 --> 00:09.830
We've covered creating reading and updating.

00:09.990 --> 00:15.140
Basically inserting selecting an update now we're going to use to.

00:15.360 --> 00:22.000
So the first thing is to delete all old shirts which really just in this case means last worne is 200

00:22.020 --> 00:23.520
Exactly.

00:24.450 --> 00:32.280
So when you do or select star you can see there's two shirts that meet that criteria 7 idea of 7 an

00:32.330 --> 00:33.370
idea of two.

00:33.660 --> 00:36.390
But we're going to delete them based off of last one.

00:36.720 --> 00:48.970
So we always start with our select star from shirts where last worn equals 200 when we get our two shirts

00:49.950 --> 00:58.970
then we can copy this and actually we can copy this entire thing delete from Schertz where last one

00:58.970 --> 01:02.000
is two hundred two rows affected.

01:02.000 --> 01:06.200
Now for us to Nexstar those two are gone.

01:06.200 --> 01:12.260
You can see it goes from one to three and then from six to eight then there we go.

01:12.270 --> 01:16.000
So the next problem is to delete all tank tops.

01:16.110 --> 01:19.300
We've decided take steps to make it look kind of stupid.

01:19.350 --> 01:21.180
So we're going into the tank tops.

01:21.450 --> 01:23.010
So your tastes have changed.

01:23.250 --> 01:24.750
So how many tank tops do we have.

01:24.870 --> 01:28.160
We've got one and two that are left.

01:28.530 --> 01:36.130
So we'll do a select star from Schertz where article equals tank top.

01:36.360 --> 01:48.740
We get to that all we need to do now is delete from Schertz where article equals tank top hit enter.

01:48.740 --> 01:50.240
Now we try and select them.

01:50.240 --> 01:51.020
They're gone.

01:51.020 --> 01:55.890
And if we do a select star from a shirt with NO WHERE clause.

01:56.150 --> 02:00.140
Now we have 1 3 5 6 9 so we've lost our two tank tops.

02:00.140 --> 02:05.920
All we have are T-shirts and polo shirts which leads us to our final exercise here.

02:06.140 --> 02:09.450
So eat all the shirts and I lied it takes me the second to last.

02:09.530 --> 02:12.420
So to delete all the shirts but not the entire table.

02:12.550 --> 02:15.050
It's pretty simple.

02:15.050 --> 02:20.180
We use the SAME WHERE clause which which is to say that we don't have a WHERE clause.

02:20.300 --> 02:24.680
So in this case it returns select star from shirts or turns all shirts.

02:24.680 --> 02:30.100
Well we just replace that delete from Schertz.

02:30.650 --> 02:33.420
I can't spell it correctly with this part.

02:34.740 --> 02:38.300
And Moment of Truth 5 rows affected.

02:38.610 --> 02:42.950
Now and if you select start from Schertz we get nothing.

02:43.000 --> 02:46.960
So sad day not as sad as we need to play to the cats but still sad.

02:47.460 --> 02:50.470
And the last thing is to drop the entire Schertz table.

02:50.700 --> 02:52.260
We're just done with this.

02:52.290 --> 02:53.580
We hated this exercise.

02:53.580 --> 02:54.830
We want to move on.

02:55.290 --> 03:01.940
So drop table shirts now hit enter.

03:02.040 --> 03:11.690
And if I do show tables no tables and if I try and describe Schertz we get an error because there is

03:11.690 --> 03:14.700
no Schertz table to describe and it freaks out.

03:14.720 --> 03:16.130
So we've successfully deleted it.

03:16.130 --> 03:20.430
Now we have an empty database that we don't need anymore and we're done with this.

03:20.450 --> 03:21.290
Congratulations.
