Instruction
That was the last exercise in this part of the course, and you passed it with flying colors—amazing! Now, take some time to relax, and proceed to the next part when you're ready.
- Subqueries are queries within queries,
- We often use them in
WHEREcondition. If the subquery returns only one value, you can use normal mathematical signs for comparison:>,>=,=,<=,<,!=,<>, - If the query returns more than one value, you have to use either
ALLorANY, - In order to check whether a set conatins a certain value, you can use
INoperator, - Correlated subqueries are subqueires that use columns from the outer query. This way you can make a subquery return a certain value for a certain row,
- Subqueries can also be used in
FROMclause. It acts just like normal table. Keep in mind that you have to give an alias to a subquery in theFROMclause, - Subqueries can also be used in
SELECTclause as a column. Just remember, that such subquery has to return only one value.
Now, take your time relaxing and proceed to the next part when you're ready.
Exercise
Click to finish this part.




