All language subtitles for 10. Logical Operators

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

In the last video, we learned how to apply one condition while retrieving data.

Let us now look at how to retrieve data, which is satisfying multiple conditions.

Multiple conditions can be applied using the and and or operators.

And operators used when we want that, all of the conditions are satisfied.

Whereas our operator will be used when we want to retrieve the data with any one of the conditions.

Satisfied.

Let us look at this syntax.

We select columns from table name where this will be the condition one.

After this, if you want to have an and operator, we will write.

And if you want all operator, we will write all and then we will specify the second condition.

We can continue doing so.

We can have a number of conditions.

Let us look at an example.

If you want to get the customers.

Who's age is between 20 and 30 years.

We can do this by using the and operator.

So these customers will be satisfying the condition that their age is more than 20 years and the age

is less than 30 years.

So we will select first name, last name and age of the customer from customer table, where age is

greater than 20 and age is less than 30.

Let us go and write this in PG admin.

Select first name.

Last name.

From.

Let's add age also.

Customer table.

Where?

It is greater than 20 and it is less than.

30.

And that's when this query.

You can see five records are retrieved.

And age of all these five customers is between 20 and 30.

Now, if we want all the other customers, that is customer whose age is less than 20 or more than 30,

we will be using the auto operator.

Let us write that.

Select.

First name.

Last name.

Age.

The age is less than 20.

Or it is greater than equal to 30.

That's when this.

You can see.

So all the customers who have less than 20 or is less than 30 have been retrieved.

These are the other five rows of the table.

Apart from and and all.

There is one more logical operator called not.

Not operator is used to negate a condition.

So last time.

When we found out that there is one customer with age 25.

If you want to find out all the other customers you can just use not.

So let us write this example where we are finding out all the customers with is not is equal to 25.

From customer table.

Where?

We are not.

Age is equal to 25.

So this will give us all the customers.

We did not equal to five.

So last time, if you remember, we got three records.

Our table has total ten records.

These are the other seven records.

Now you can use this knot operator along with and another operator.

So, for example, if you want to specify that you want to get all the customers with age not equal

to 25 and the customer's first name should not be G.

So both of these conditions can be applied simultaneously.

We will select start.

From customer table.

We're.

Not age is equal to 25.

They're not.

Age is equal to 25.

And.

Not.

First name.

Is equal to.

J.

You run this.

See, the J records are also removed.

Now we have only four records.

And the result?

So these are the three logical operators which help us put multiple conditions in the same query.

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