A subquery is a very useful tool to solve certain special problems. It can return values to form a condition or to add a column. There are mainly three different usages:
Although you can add a subquery within a subquery and the level for subquery can be more than two, it is not recommended. The more sublevels that exist in your query, the more trouble you may end up with. It is not worth the effort to create such a monster-like query unless you do not have any other choice.
The following query example cases belong to the first two categories. No subquery within a subquery is shown here due to the obvious reason just mentioned.