All language subtitles for 1. CASE WHEN

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 Hi everyone 1

In this video 2

We'll learn about case expression 3

Case expression is a conditional expression 4

What is mean this if you want to specify several conditions on your data 5

While 6

Retrieving it or updating it 7

You can do it using the case expression 8

It is similar to mentioning the if else statements 9

While coding, so if you have done C , C++ or java 10

What you achieve by using if and else statements similar thing you can do using the case statement 11

The syntax of case statement is you write case 12

Then you mention when 13

Specify the first condition if it is true then 14

The result 15

You can again mention the second when, where you specify the second condition and if that is true 16

It will give the result 17

3rd, 4th and so on 18

And in the end you can specify else so if none of the condition specified above are true 19

The else will run 20

And whatever result you mentioned within this else clause 21

That will be executed 22

And to end the 23

Case expression we write end 24

There is another way to use case, you will write case and then mention an expression 25

This expression can be a column name 26

For each value in the column 27

This condition will be checked and wherever this condition is true 28

You will get the 29

Result corresponding to that condition 30

Let us look at 31

An example to understand it further 32

One of the major use cases of 33

Case statement is 34

When you want to assign categories to your data 35

So for example, in my customer data 36

If I want to categorise my 37

Customer data into 3 parts 38

Customers age Less than 30 will be categorised as young 39

Customers aged 30 to 60 will be called middle aged and customers 40

Beyond 60 years will be 41

Categorised as senior citizens 42

If I want to do this 43

I'll use case 44

I'll write select star so this will give me all the columns of the customer table 45

Comma 46

Case, so this will become a new column in after the entire table, so this column 47

Will be named case 48

And within this column, I want data 49

Such that 50

Customers who have age less 30 this column should contain young 51

Customers with age more than 60 this column should contain senior citizen 52

For all other customers 53

This column should contain middle aged 54

To finish this case statement 55

I'll write end 56

I can assign this whole column a name by using as age category 57

I do not write this 58

This column will be named as case 59

Now 60

Since I am using this alias this column will be named as age category 61

From 62

Customer table 63

Let us go and write this query in pg admin 64

We will select star 65

Comma case 66

When 67

Age is less than 30 68

Then output should be young 69

When age 70

Is more than 60 71

Then 72

Senior citizen 73

Else 74

Middle aged 75

End as 76

Age category 77

From 78

Customer 79

Let us run this 80

So if you scroll to the right 81

This new column will be 82

In the end 83

It is named as age category 84

And you can see 85

For customer with age 67, it has value senior citizen 86

For customer with age 33 it has 87

Value Middle aged 88

For customer with Value 20 89

It is young 90

This is how we use this conditional expression of case 91

That's all for this video, thanks

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