All language subtitles for 7. COUNT

af Afrikaans
ak Akan
sq Albanian
am Amharic
ar Arabic
hy Armenian
az Azerbaijani
eu Basque
be Belarusian
bem Bemba
bn Bengali
bh Bihari
bs Bosnian
br Breton
bg Bulgarian
km Cambodian
ca Catalan
ceb Cebuano
chr Cherokee
ny Chichewa
zh-CN Chinese (Simplified)
zh-TW Chinese (Traditional)
co Corsican
hr Croatian
cs Czech
da Danish
nl Dutch
en English
eo Esperanto
et Estonian
ee Ewe
fo Faroese
tl Filipino
fi Finnish
fr French Download
fy Frisian
gaa Ga
gl Galician
ka Georgian
de German
el Greek
gn Guarani
gu Gujarati
ht Haitian Creole
ha Hausa
haw Hawaiian
iw Hebrew
hi Hindi
hmn Hmong
hu Hungarian
is Icelandic
ig Igbo
id Indonesian
ia Interlingua
ga Irish
it Italian
ja Japanese
jw Javanese
kn Kannada
kk Kazakh
rw Kinyarwanda
rn Kirundi
kg Kongo
ko Korean
kri Krio (Sierra Leone)
ku Kurdish
ckb Kurdish (Soranî)
ky Kyrgyz
lo Laothian
la Latin
lv Latvian
ln Lingala
lt Lithuanian
loz Lozi
lg Luganda
ach Luo
lb Luxembourgish
mk Macedonian
mg Malagasy
ms Malay
ml Malayalam
mt Maltese
mi Maori
mr Marathi
mfe Mauritian Creole
mo Moldavian
mn Mongolian
my Myanmar (Burmese)
sr-ME Montenegrin
ne Nepali
pcm Nigerian Pidgin
nso Northern Sotho
no Norwegian
nn Norwegian (Nynorsk)
oc Occitan
or Oriya
om Oromo
ps Pashto
fa Persian
pl Polish
pt-BR Portuguese (Brazil)
pt Portuguese (Portugal)
pa Punjabi
qu Quechua
ro Romanian
rm Romansh
nyn Runyakitara
ru Russian
sm Samoan
gd Scots Gaelic
sr Serbian
sh Serbo-Croatian
st Sesotho
tn Setswana
crs Seychellois Creole
sn Shona
sd Sindhi
si Sinhalese
sk Slovak
sl Slovenian
so Somali
es Spanish
es-419 Spanish (Latin American)
su Sundanese
sw Swahili
sv Swedish
tg Tajik
ta Tamil
tt Tatar
te Telugu
th Thai
ti Tigrinya
to Tonga
lua Tshiluba
tum Tumbuka
tr Turkish
tk Turkmen
tw Twi
ug Uighur
uk Ukrainian
ur Urdu
uz Uzbek
vi Vietnamese
cy Welsh
wo Wolof
xh Xhosa
yi Yiddish
yo Yoruba
zu Zulu
Would you like to inspect the original subtitles? These are the user uploaded subtitles that are being translated: 1 00:00:00,650 --> 00:00:04,130 Now the next aggregate function is count function. 2 00:00:05,290 --> 00:00:12,910 As the name suggests, Count will add a column with the number of rows within the window frame. 3 00:00:13,830 --> 00:00:22,650 For example, if we have customer and store and we want a new column which stores the information of 4 00:00:22,710 --> 00:00:27,790 how many customers each store have, then we can use count. 5 00:00:27,810 --> 00:00:32,510 It is very similar to average just inside of calculating average. 6 00:00:32,520 --> 00:00:36,330 It is calculating the count of rows. 7 00:00:38,980 --> 00:00:46,930 So here in our data, we have three customers in store A we have four customers in the store. 8 00:00:46,960 --> 00:00:56,530 B So for all the customers who are from a story, we want three and for all the customers who are from 9 00:00:56,530 --> 00:00:56,950 a store. 10 00:00:56,980 --> 00:00:59,590 B, we want value as four. 11 00:00:59,620 --> 00:01:05,650 So this is the final table we want for C, one, C five and C seven. 12 00:01:05,650 --> 00:01:11,440 We want value as three since there are three customers in the story. 13 00:01:11,650 --> 00:01:15,520 And for C, two, C, three, C, four and C six. 14 00:01:15,520 --> 00:01:20,740 We want the value is four since there are four customers from store B. 15 00:01:21,880 --> 00:01:23,920 Now let's go to our pkg admin. 16 00:01:25,180 --> 00:01:32,050 So now let's create a column with a total number of customers from each estate. 17 00:01:35,060 --> 00:01:37,430 So we want select. 18 00:01:38,890 --> 00:01:40,080 Because somebody. 19 00:01:43,090 --> 00:01:44,200 Customer name. 20 00:01:46,980 --> 00:01:47,670 Cuomo. 21 00:01:49,410 --> 00:01:50,340 Estate. 22 00:01:50,730 --> 00:01:55,280 Then we wanted to count off customer IDs in each state. 23 00:01:55,290 --> 00:01:59,040 So count is our function and bracket. 24 00:01:59,070 --> 00:02:01,530 I have to write what I want to count. 25 00:02:01,860 --> 00:02:05,640 So here we are, counting the customer IDs in each state. 26 00:02:05,640 --> 00:02:07,650 So we'll write customer. 27 00:02:09,330 --> 00:02:10,020 Heidi. 28 00:02:10,410 --> 00:02:16,290 In this case, you can also write customer name instead of customer ID, It will give you the same result. 29 00:02:17,520 --> 00:02:22,620 Then we will write the over keyword and in bracket we'll write partition by. 30 00:02:26,160 --> 00:02:27,750 And then we'll write estate. 31 00:02:27,750 --> 00:02:33,000 Since we want to partition our data and calculate count in each state. 32 00:02:33,930 --> 00:02:42,450 Then we can give Alias and we'll give an alias of count of customer count cost. 33 00:02:44,780 --> 00:02:51,770 And we want this data from our customer order table that we created in our previous lectures. 34 00:02:56,160 --> 00:02:57,870 I think our query is ready. 35 00:02:58,110 --> 00:02:59,580 Let's just run this. 36 00:03:02,960 --> 00:03:05,480 You can see that from Alabama. 37 00:03:05,480 --> 00:03:10,430 We have one, two, three, four, five, six, seven, eight, nine customers. 38 00:03:10,670 --> 00:03:16,760 That's why in front of every customer who is from Alabama, we are getting nine. 39 00:03:18,040 --> 00:03:19,240 And Arizona. 40 00:03:19,240 --> 00:03:21,040 We have 21 customers. 41 00:03:21,040 --> 00:03:24,520 So for each customer we are getting 21. 42 00:03:24,640 --> 00:03:25,720 In this column. 43 00:03:27,730 --> 00:03:30,970 In California, we have around 161 customers. 44 00:03:35,810 --> 00:03:42,050 Similarly, in Michigan, we have 16, so all the customers who are from Michigan have 16 value. 45 00:03:42,050 --> 00:03:43,070 And this column. 46 00:03:45,590 --> 00:03:48,650 So that's how we use count window function. 47 00:03:48,860 --> 00:03:53,720 In the next lecture we'll see how to calculate sum or total. 4104

Can't find what you're looking for?
Get subtitles in any language from opensubtitles.com, and translate them here.