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
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

Original subtitles

Now the next aggregate function is count function.

As the name suggests, Count will add a column with the number of rows within the window frame.

For example, if we have customer and store and we want a new column which stores the information of

how many customers each store have, then we can use count.

It is very similar to average just inside of calculating average.

It is calculating the count of rows.

So here in our data, we have three customers in store A we have four customers in the store.

B So for all the customers who are from a story, we want three and for all the customers who are from

a store.

B, we want value as four.

So this is the final table we want for C, one, C five and C seven.

We want value as three since there are three customers in the story.

And for C, two, C, three, C, four and C six.

We want the value is four since there are four customers from store B.

Now let's go to our pkg admin.

So now let's create a column with a total number of customers from each estate.

So we want select.

Because somebody.

Customer name.

Cuomo.

Estate.

Then we wanted to count off customer IDs in each state.

So count is our function and bracket.

I have to write what I want to count.

So here we are, counting the customer IDs in each state.

So we'll write customer.

Heidi.

In this case, you can also write customer name instead of customer ID, It will give you the same result.

Then we will write the over keyword and in bracket we'll write partition by.

And then we'll write estate.

Since we want to partition our data and calculate count in each state.

Then we can give Alias and we'll give an alias of count of customer count cost.

And we want this data from our customer order table that we created in our previous lectures.

I think our query is ready.

Let's just run this.

You can see that from Alabama.

We have one, two, three, four, five, six, seven, eight, nine customers.

That's why in front of every customer who is from Alabama, we are getting nine.

And Arizona.

We have 21 customers.

So for each customer we are getting 21.

In this column.

In California, we have around 161 customers.

Similarly, in Michigan, we have 16, so all the customers who are from Michigan have 16 value.

And this column.

So that's how we use count window function.

In the next lecture we'll see how to calculate sum or total.

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