Would you like to inspect the original subtitles? These are the user uploaded subtitles that are being translated:
0
1
00:00:02,048 --> 00:00:03,840
Now, Let us look at the average function
1
2
00:00:04,096 --> 00:00:08,960
Average as you must be knowing is the average or the mean value of all the values that we have
2
3
00:00:09,216 --> 00:00:10,496
provided as an input
3
4
00:00:11,008 --> 00:00:14,080
So if you want to get average of any particular column
4
5
00:00:14,592 --> 00:00:15,360
We'll use
5
6
00:00:15,616 --> 00:00:16,384
AVG
6
7
00:00:16,640 --> 00:00:17,920
Which is the average function
7
8
00:00:19,200 --> 00:00:20,736
The syntax of this is, select
8
9
00:00:20,992 --> 00:00:21,760
AVG
9
10
00:00:22,016 --> 00:00:23,296
Mention the column name
10
11
00:00:23,552 --> 00:00:27,392
You can mention other column names also there, after this from tablename
11
12
00:00:27,648 --> 00:00:30,464
And you can specify condition using the where
12
13
00:00:30,720 --> 00:00:31,744
If you want to
13
14
00:00:35,328 --> 00:00:37,120
Let us look at some examples
14
15
00:00:37,632 --> 00:00:41,984
Suppose you want to find out what is the average age of the customers
15
16
00:00:42,240 --> 00:00:43,008
Who are buying
16
17
00:00:43,520 --> 00:00:44,288
At our Store
17
18
00:00:46,080 --> 00:00:48,640
To do that we'll write select
18
19
00:00:48,896 --> 00:00:50,176
Average age
19
20
00:00:50,432 --> 00:00:52,480
As Average customer age
20
21
00:00:52,736 --> 00:00:56,576
From the customer table, So let us go and write this query
21
22
00:00:56,832 --> 00:01:02,976
Select AVG age, This is the column
22
23
00:01:03,232 --> 00:01:09,376
Of which I want to get the average, as average customer age
23
24
00:01:10,912 --> 00:01:17,056
From the customer table
24
25
00:01:17,312 --> 00:01:18,592
Let us run this
25
26
00:01:20,896 --> 00:01:24,480
The average age of customer who is coming to our Store
26
27
00:01:24,736 --> 00:01:25,248
Is
27
28
00:01:25,760 --> 00:01:26,784
44 years
28
29
00:01:30,112 --> 00:01:33,952
Now, suppose we want to find out average commission I am paying
29
30
00:01:34,208 --> 00:01:34,976
Per order
30
31
00:01:36,256 --> 00:01:38,304
For every order, if I am paying out
31
32
00:01:38,560 --> 00:01:41,120
10% of the sales value as Commission
32
33
00:01:41,376 --> 00:01:45,984
So average Commission will be average of the total sales into 10%
33
34
00:01:47,520 --> 00:01:50,336
To do that, we will write select
34
35
00:01:51,104 --> 00:01:51,872
AVG
35
36
00:01:52,384 --> 00:01:56,480
Sales into 10% as average Commission value from sales
36
37
00:01:57,504 --> 00:01:59,040
Let's go and write this query
37
38
00:01:59,296 --> 00:02:02,624
Select
38
39
00:02:03,136 --> 00:02:05,440
AVG
39
40
00:02:06,208 --> 00:02:10,304
Sales into 10% into 0.10
40
41
00:02:11,328 --> 00:02:13,632
0.10
41
42
00:02:16,192 --> 00:02:22,336
As average Commission value
42
43
00:02:26,944 --> 00:02:29,504
From the sales table
43
44
00:02:30,016 --> 00:02:33,600
You can see
44
45
00:02:34,112 --> 00:02:40,256
It will find the total of sales into 10% and then save it as average and the average
45
46
00:02:40,512 --> 00:02:43,584
Commission I am paying is 22.9 units
46
47
00:02:46,400 --> 00:02:48,448
This is how we use the average
47
48
00:02:48,704 --> 00:02:52,544
Function, next we'll look at the min and max functions
3541
Can't find what you're looking for?
Get subtitles in any language from opensubtitles.com, and translate them here.