Summary
Today, you performed dozens of exercises involving subqueries. By doing this, you have learned how to use one of the most important parts of SQL. The subquery is a method for placing additional conditions on the data returned by your query. A subquery provides great flexibility in defining conditions, especially conditions for which you do not know the exact value. For example, I might want to get a list of all the products priced above average, but I might not know what the overall average price is offhand. I can include a subquery that calculates the average price.
Today, you also tackled one of the most difficult parts of SQL: a correlated subquery. The correlated subquery creates a relationship between the query and the subquery, ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access