WEBVTT

00:07.370 --> 00:10.940
I will call you back again to another video lecture in MySQL.

00:10.940 --> 00:15.590
And in this video lecture we go ahead and learn how to select the tag from our table.

00:15.680 --> 00:18.140
So we have nobody inside the target table.

00:18.170 --> 00:20.150
Now let's learn how to select that.

00:20.480 --> 00:26.840
One of the ways we should learn previously is how to select all of the table which is select and the

00:26.840 --> 00:28.130
accessories is all.

00:28.130 --> 00:30.410
And then you go ahead and say from.

00:30.440 --> 00:34.280
And then the table name is students.

00:34.310 --> 00:37.640
Then put a semicolon at the end and execute the query.

00:37.640 --> 00:39.410
And we have the table running here.

00:39.560 --> 00:43.370
So we have already selected everything inside the table.

00:43.400 --> 00:50.150
Now what if we want to select maybe some of the data, maybe the column, the first name, the last

00:50.150 --> 00:53.360
name, the GPA enrolled date, and so on.

00:53.360 --> 00:58.700
What I need to do is that I'm going to remove the exteriors, and then I'm going to specify the data

00:58.700 --> 00:59.540
I want to select.

00:59.540 --> 01:04.400
Maybe I want to select the enrolled date or guidelines say enroll underscore date.

01:04.400 --> 01:07.420
And then I will go ahead and execute this query.

01:07.420 --> 01:08.230
So we check it out.

01:08.230 --> 01:12.670
So you can see I was able to be able to print out just the error date.

01:12.670 --> 01:13.870
So I can put a comma.

01:13.870 --> 01:16.930
And then I'll go ahead and say maybe I want to add GP.

01:17.140 --> 01:18.790
And if I say that.

01:18.790 --> 01:21.520
So first of all make it to be orderly.

01:21.520 --> 01:25.900
I can say GP and then a warhead and execute that.

01:25.900 --> 01:29.830
And you can see that I have GP and I have a route date.

01:29.920 --> 01:31.420
I can also reorder that.

01:31.420 --> 01:40.030
Maybe I can go in and say a road date and violence GP and then I'll go here and select that and you

01:40.030 --> 01:43.240
can see I have the road dates come first and then the GP.

01:43.240 --> 01:47.020
So it's something like saying I want to select the first name and last name.

01:47.050 --> 01:53.050
Can I go ahead and say las underscore name comma and then the first underscore name.

01:53.050 --> 01:55.420
And then go ahead and execute the query.

01:55.420 --> 01:59.770
And you can see the last name con before the first name order is cool.

01:59.770 --> 02:01.390
So this is a way to be able to select.

02:01.390 --> 02:06.100
You can select the individual uh column and I print it out.

02:06.130 --> 02:08.320
Maybe you just want to select only the first name.

02:08.320 --> 02:14.170
You go ahead and execute curious query and only the first name is printed out.

02:14.740 --> 02:22.180
So this is a way we would select, um, each of the column and print them out, or select a specific

02:22.180 --> 02:25.090
amount of column you want to print out, and that will come out.

02:25.120 --> 02:28.120
Now what if we use what is called the Where clause.

02:28.150 --> 02:30.100
Yes, we have what is called Where clause.

02:30.130 --> 02:32.470
Let me say I want to select every data.

02:32.830 --> 02:39.100
And I'm going to say select every data where then you cannot specify whatever you want.

02:39.130 --> 02:42.160
Maybe where are the students.

02:44.500 --> 02:45.610
Well these are my students.

02:45.610 --> 02:52.090
So that we are students underscore ID is equal to one.

02:52.090 --> 02:57.190
And I need to select all where the stress ID is equal to one.

02:57.190 --> 03:04.930
And if I go here as as a query I have to what is selected because I need where the student ID is equal

03:04.930 --> 03:05.530
to one.

03:05.560 --> 03:10.420
Now if I want to select where not yes, we are not.

03:10.450 --> 03:14.550
If I put in this exclamation mark before the equal sign.

03:14.580 --> 03:21.990
It means I want to select all the data or the IDs which are not equal to one.

03:21.990 --> 03:30.120
And let's go ahead and execute this code and check it out so we can see that our the first ID pizza

03:30.150 --> 03:31.260
is omitted.

03:31.260 --> 03:32.370
That is the first one.

03:32.370 --> 03:37.470
One which is pizza is omitted and is printed out from 2 to 8.

03:37.470 --> 03:40.560
So this is a where clause we can specify.

03:40.590 --> 03:44.550
Maybe we want to select everything where this happens.

03:44.580 --> 03:46.740
Let me go ahead and save this guide or remove this.

03:46.740 --> 03:57.660
And let me say I want to select all where maybe the first underscore name is equal to Barack.

03:57.660 --> 04:04.560
So so I want to put this memory this is going to be inside the quotation mark Barack.

04:04.590 --> 04:06.060
And here I have Barack.

04:06.060 --> 04:07.590
And that is what I want to select.

04:07.590 --> 04:14.190
And if I should go ahead and run this, I have Barack, which is ID three, which is selected for me.

04:14.430 --> 04:21.660
So let me go ahead and say I want to select where the GP is greater than 3.5.

04:21.660 --> 04:31.200
So go ahead and say I want to select everything from students where GP is greater than or equal to 3.5.

04:31.200 --> 04:34.230
And let's go ahead and execute this query.

04:35.160 --> 04:40.320
And now we have ID one, two, three, four and six.

04:40.320 --> 04:43.470
So every row is below 3.5.

04:43.470 --> 04:46.830
So if I go ahead and say maybe 4.0.

04:46.830 --> 04:50.820
So go ahead and change this to 4.0.

04:51.240 --> 04:52.800
So this go ahead and check it out.

04:52.800 --> 04:54.330
And it's the cutest query.

04:54.360 --> 04:55.230
Let's check it out.

04:55.230 --> 05:00.660
So only two out of the data we have in the table meets all the requirements.

05:00.660 --> 05:07.170
So we have 4.7 and 4.8 and the reservoir at below 4.0.

05:07.170 --> 05:10.050
So what do you want to select the error dates.

05:10.140 --> 05:14.460
Remedy will have this error dates 29 to 1 1118.

05:14.460 --> 05:21.720
So let's go ahead to select dates I'm going to say we are a row underscore dates.

05:21.750 --> 05:22.890
So go ahead and shift.

05:22.890 --> 05:22.910
ship.

05:22.910 --> 05:25.700
This is a code tool.

05:25.790 --> 05:28.790
So I want to specify this date that I have here.

05:28.790 --> 05:32.000
So I have so many like about three of them where we created that.

05:32.000 --> 05:34.010
And this is the cutest query.

05:34.010 --> 05:34.970
And check it out.

05:35.630 --> 05:44.270
So we have this tool here which is a 2019 one 1118 okay.

05:44.270 --> 05:51.440
So if I go ahead and select and when I check all the students and know the dates that are many, so

05:51.440 --> 05:53.450
go ahead and execute this.

05:53.450 --> 05:57.710
So we have our 2019 one okay.

05:57.740 --> 06:01.280
We have this tool and that is why we have just that.

06:01.280 --> 06:06.860
So only these two this is a 2097 and not 2091 because I was expecting three to come out.

06:06.860 --> 06:08.090
And it is correct.

06:08.090 --> 06:12.380
Right in here that is 2097 and not 2091 as well.

06:13.130 --> 06:14.720
So how many is cool.

06:14.750 --> 06:15.830
Go ahead and check it out.

06:15.830 --> 06:19.010
So what if I want to say maybe I want to select.

06:20.180 --> 06:21.920
Let me go ahead and put this back again.

06:21.920 --> 06:27.740
We had date is greater than or this guy had a we can actually do date.

06:27.740 --> 06:27.760
this.

06:27.790 --> 06:31.720
We are data is greater than 2091.

06:31.750 --> 06:33.640
Go ahead and execute this query and check it out.

06:33.640 --> 06:38.110
So we selected date which is greater than or equal to.

06:38.140 --> 06:41.890
So if I go ahead and remove the equal sign this is the cutest query.

06:41.890 --> 06:45.010
And you have the ones that are greater than 2091.

06:45.010 --> 06:47.350
So 2091 is not included right in here.

06:47.380 --> 06:48.490
So you can see that.

06:48.490 --> 06:49.720
So that is cool.

06:49.750 --> 06:53.260
And what if you want to select where date is.

06:53.260 --> 06:53.710
No.

06:53.710 --> 06:54.430
Remember that one.

06:54.430 --> 06:56.410
We added some data.

06:56.440 --> 07:03.550
Last we omit some of the columns like uh the enrolled dates.

07:03.550 --> 07:08.320
So you want to do that I'm going to say we add date is no enrolled.

07:08.320 --> 07:09.130
It is no.

07:09.220 --> 07:10.780
Go ahead and execute this query.

07:10.780 --> 07:12.880
And I have George Steve.

07:12.880 --> 07:16.780
So now GP and no enroll date.

07:16.930 --> 07:17.470
Right.

07:17.470 --> 07:24.310
So if we also put everything that is the one that have eroded but are not.

07:24.310 --> 07:24.760
No.

07:24.790 --> 07:26.890
Go ahead and say is not no.

07:26.890 --> 07:28.360
And that is a cute query.

07:28.360 --> 07:29.470
And let's check it out.

07:29.470 --> 07:34.120
And you can no longer see if I drag this up and go ahead and drag this up.

07:34.150 --> 07:40.000
You can see that Judge Steve is not included because Judge Steve is no right.

07:40.030 --> 07:41.500
So that is cool.

07:41.530 --> 07:45.580
Go ahead and drag this down again so that we have a space right in here.

07:45.580 --> 07:48.610
And that is cool.

07:48.610 --> 07:52.120
So this is a way you can be able to select data from your table.

07:52.150 --> 07:54.940
You can play around with every one of these okay.

07:54.970 --> 07:58.450
So go ahead and put back our select okay.

07:58.450 --> 08:01.510
Then go ahead and select everything.

08:02.230 --> 08:02.590
All right.

08:02.620 --> 08:05.560
Now go ahead and select everything.

08:05.560 --> 08:10.600
And down here you can see that Steve is already included okay.

08:10.600 --> 08:11.590
So that is cool.

08:11.590 --> 08:14.470
We have everything printed out printed out for us.

08:14.470 --> 08:16.990
And that is very interesting pronoun with them.

08:16.990 --> 08:20.710
And if you have any questions on please go ahead and use the question and answer section.

08:20.710 --> 08:23.290
And I'm going to get back to you as soon as possible.

08:23.320 --> 08:24.250
Thank you so much.

08:24.250 --> 08:27.130
And I'm going to see you in the next video lecture.
