Afrikaans
Akan
Albanian
Amharic
Arabic
Armenian
Azerbaijani
Basque
Belarusian
Bemba
Bengali
Bihari
Bosnian
Breton
Bulgarian
Cambodian
Catalan
Cebuano
Cherokee
Chichewa
Chinese (Simplified)
Chinese (Traditional)
Corsican
Croatian
Czech
Danish
Dutch
English
Esperanto
Estonian
Ewe
Faroese
Filipino
Finnish
Frisian
Ga
Galician
Georgian
German
Greek
Guarani
Gujarati
Haitian Creole
Hausa
Hawaiian
Hebrew
Hindi
Hmong
Hungarian
Icelandic
Igbo
Indonesian
Interlingua
Irish
Italian
Japanese
Javanese
Kannada
Kazakh
Kinyarwanda
Kirundi
Kongo
Korean
Krio (Sierra Leone)
Kurdish
Kurdish (Soranรฎ)
Kyrgyz
Laothian
Latin
Latvian
Lingala
Lithuanian
Lozi
Luganda
Luo
Luxembourgish
Macedonian
Malagasy
Malay
Malayalam
Maltese
Maori
Marathi
Mauritian Creole
Moldavian
Mongolian
Myanmar (Burmese)
Montenegrin
Nepali
Nigerian Pidgin
Northern Sotho
Norwegian
Norwegian (Nynorsk)
Occitan
Oriya
Oromo
Pashto
Persian
Polish
Portuguese (Brazil)
Portuguese (Portugal)
Punjabi
Quechua
Romanian
Romansh
Runyakitara
Russian
Samoan
Scots Gaelic
Serbian
Serbo-Croatian
Sesotho
Setswana
Seychellois Creole
Shona
Sindhi
Sinhalese
Slovak
Slovenian
Somali
Spanish
Spanish (Latin American)
Sundanese
Swahili
Swedish
Tajik
Tamil
Tatar
Telugu
Thai
Tigrinya
Tonga
Tshiluba
Tumbuka
Turkish
Turkmen
Twi
Uighur
Ukrainian
Urdu
Uzbek
Vietnamese
Welsh
Wolof
Xhosa
Yiddish
Yoruba
Zulu
In the last video, we learned how to retrieve all the rows of the table.
Let us now look at how to retrieve data, which is satisfying a particular specified condition.
Condition is specified using the clause.
Let us see the syntax of this clause.
It starts with select.
You enter all the column names which you want to retrieve from the table name, and then you specify
the condition after the where clause.
Let us look at some examples of these conditions.
Let's say we want to find out if there is any customer who is 25 years old.
This is how we do it.
Select first name from Customer table where age is equal to 25.
This age is equal to 25 will be the condition.
If it is satisfied, we will get a response back.
If it is not, we will get a null response back.
Let us run this query.
Select first name.
From customer table.
Where it is equal to.
25.
Only the customer with first name G is having age 25.
If you wanted the distinct values, you could have used select distinct roles that would have given
you distinct response.
Let us do that.
Run it.
You see, only one G returned.
Now, if you want to put a condition of age more than 25.
You can just change this equal to sign to greater than sign.
And then run this query.
The condition that we apply right now is numeric and correct.
That is, we are checking if that particular number is equal to or more than 25 or not.
We can put conditions on textual variables also.
You can match the variable.
So, for example, if you want to get all the information of the customer with first name G.
We will select star.
From customer table.
We're.
First name.
The.
This query.
You can see all the columns have been retrieved, but only those rows we have got as a result which
have first name as G.
One more thing you can note is in the previous query, we retrieved only first name, but we put a check
on the Age column.
So these two columns were different.
This is allowed by PostgreSQL.
So some variants of the SQL Server would make it necessary that the column on which you put your condition
is part of your selected columns.
But the way we wrote the query that is allowed by PostgreSQL.
So in this video we learned how to put condition while retrieving data.
Next, we will learn how to put multiple conditions at the same time in the same query using an and
or operator.
Can't find what you're looking for?
Get subtitles in any language from opensubtitles.com, and translate them here.