All language subtitles for 1. 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

0 Now, we will be discussing some of the aggregate functions such as count, sum, average 1

Min and max 2

First is the count function 3

Count function will return the count of the expression that you have mentioned 4

For example if you want to find out the number of sales that you have done 5

You can count the number of sales lines that you have, to get the total number of sales that you are done 6

Or you want to find out the count of customers with name starting with A 7

Then again count function will help you 8

The syntax of count function is 9

You select the column names if you want 10

Count will be written as count and then you give the column name 11

Of the column of which you want the 12

Count 13

So it will count number of non null values in that column 14

After it has applied the condition so if you are mentioned any where clause 15

It will check the condition 16

And after that if there is any non null value in that particular column which were mentioned after the count 17

It will give that particular count 18

Let's look at some of the examples to understand this 19

So this first example where I have returned select count star from sales 20

It will 21

Go to the sales table 22

And it will 23

Look at all the records 24

And it will give back the count of all the rows in that particular table 25

Let it go and write this in the PG admin interface 26

Select 27

Count star 28

Remember that I put the star 29

Within the bracket 30

Whatever column name you want to mention you have to put it into bracket, from sales, sales is the table name 31

When I run this 32

I get a count of 33

9994 34

This is the total count but if you notice the column name is written as count 35

This may not make any sense to anyone who looks at this count that is why we will be using aliases 36

And mention 37

Count star as 38

The total count of sales something like that 39

So that we get the right column name 40

Now, Imagine if you want to find out 41

How many orders that particular customer has given 42

And how many products that particular customer has ordered 43

Go and look at the 44

Sales table 45

By just doing select star from sales 46

So for example, this first customer with customer ID CG 12520 47

It has two entries on the top those two entries have the same order ID 48

Which means it was one single order 49

In which two different products were ordered so the product ID in both these 50

Two rows is different 51

If I want to find out 52

Count of all the orders that this particular customer has given 53

And the count of different products that this customer has ordered 54

I start typing 55

Select 56

And select the count of 57

Order lines 58

So each separate order line is giving me the number of products that that particular customer has ordered 59

So I Name this as 60

Number of products ordered 61

Then I'll find out 62

Count of 63

Order IDs 64

Distinct order ID 65

If I do not write distinct 66

Repetitive order IDS will be 67

Will be counted multiple Times 68

As number of orders 69

And 70

This will be from the table 71

Sales 72

Where customer ID 73

Will be this CG 12520 74

CG12520 75

CG12520 76

Select this query and run it 77

You can see 78

The column names are the ones 79

That we provided 80

And 81

This particular customer 82

Ordered three times 83

He gave three orders 84

But 85

One or more of the orders has multiple products in it so 86

Total number of products ordered by this customer is 5 87

Next we'll look at how to use 88

Sum function

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