WEBVTT

00:07.550 --> 00:07.970
All right.

00:08.000 --> 00:13.100
So let's go ahead and look at something very interesting in this group by class.

00:13.490 --> 00:15.290
Now we have level two count.

00:15.290 --> 00:19.280
And we get every strand from each of these countries.

00:19.310 --> 00:29.120
And now what if you are asked to give the countries where strands are above or equal to 6 or 5 or specific

00:29.120 --> 00:31.790
number, or 20 or 40 or 100.

00:31.820 --> 00:33.710
How can you be able to do that?

00:33.740 --> 00:35.480
So this is a really big challenge.

00:35.480 --> 00:40.400
And you may be like, wow, how can we be able to give that comparison right in here?

00:40.940 --> 00:43.460
Now let me go ahead and show you how to do this.

00:43.580 --> 00:51.050
Now you have been able to count and now you say count every column from strands group by country.

00:51.050 --> 00:56.120
Then order by country and order by country is to make these things to be alphabetical.

00:56.150 --> 00:56.750
Right?

00:56.780 --> 01:07.690
Now, if I want to actually get the number of countries that are above that have students above 6 or

01:07.690 --> 01:15.420
5, or I need to know is that before I order it, I will go ahead and put in a cloth known as heaven

01:15.420 --> 01:21.030
and go right in here, group by country, a warhead, and see heaven.

01:21.030 --> 01:28.830
And then, because we need the count, people who are above 6 or 5, we don't start from five.

01:28.860 --> 01:34.590
All I need to do is go ahead and say count, and I'm going to count every column.

01:34.620 --> 01:43.410
Therefore, I'll go ahead and put exteriors, and then I will go ahead and say, I want people who are

01:43.440 --> 01:50.520
greater than five, and let's go ahead and execute this query.

01:50.550 --> 01:56.220
Now I have people who are greater than five and I have 30 of these.

01:56.250 --> 01:58.650
The score ahead and drag this up a little bit.

02:00.630 --> 02:01.050
All right.

02:01.080 --> 02:08.850
Now you can see that I have Afghanistan six, Argentina 16 and seven and so on.

02:08.850 --> 02:13.440
I have no one which is less than or equal to five.

02:13.470 --> 02:15.660
What if I want to include five?

02:15.690 --> 02:18.080
Let me say people who are from five and above.

02:18.110 --> 02:23.600
All I need to do is to go ahead and say greater than or equal to five.

02:23.600 --> 02:30.800
And then if I execute this query, you can see I have a bunch of five and many of five Bangladesh five.

02:30.830 --> 02:31.430
All right.

02:31.430 --> 02:34.580
But you don't have anything less than five right in here.

02:35.150 --> 02:37.250
You don't have anything less than five right in here.

02:37.250 --> 02:42.590
And in that case, if you are asked to get people who are less than or equal to five, you are here

02:42.590 --> 02:45.260
and say this is less than or equal to five.

02:45.260 --> 02:51.020
And if you go ahead and execute this query, we are going to get only people who are less than or equal

02:51.020 --> 02:51.740
to five.

02:51.770 --> 02:59.060
And you can see we have only the countries where the students are just less than or equal to five.

02:59.060 --> 03:03.740
And if I go ahead and remove the equal sign, I'm not going to include five.

03:03.740 --> 03:08.210
So every of this country have students less than five.

03:08.810 --> 03:14.330
So just like we know that there are countries that have students above 100.

03:14.330 --> 03:21.530
And if I go ahead and say we need country where students are equal to greater than or equal to 100,

03:21.560 --> 03:23.900
I'll go ahead and change this to 100.

03:23.930 --> 03:25.430
Let's go ahead and check it out.

03:25.920 --> 03:30.000
And we are going to get China and Indonesia.

03:31.140 --> 03:32.070
You see that?

03:32.100 --> 03:33.690
China and Indonesia.

03:33.690 --> 03:39.630
So these are the only countries where students are greater than or equal to 100.

03:39.630 --> 03:48.450
So the the having clause has also to be able to group these according to specific number.

03:49.140 --> 03:53.700
So you can able to group according to specific number for right.

03:53.730 --> 03:54.660
I hope that is cool.

03:54.660 --> 03:59.460
So the group by clause group this according to the accounts.

03:59.460 --> 04:05.430
But having grouped these according to the non bias the specific non bias that you need.

04:05.430 --> 04:13.560
So you can be able to filter that using the operators greater than equal less than or less than or equal

04:13.560 --> 04:14.730
and so on.

04:14.730 --> 04:16.950
So while I check it out practice with it.

04:16.980 --> 04:21.060
And if you have any questions, go ahead and use the question and answer section.

04:21.060 --> 04:23.970
And I'm going to get back to you as soon as possible.

04:24.000 --> 04:24.990
Thank you so much.

04:24.990 --> 04:27.900
And I'm going to see you in the next video lecture.
