Summary
In this chapter, we have covered how to use HAVING
clauses, subqueries, and joins in Python. We have also seen:
How to restrict results using
HAVING
How
HAVING
differs fromWHERE
When it is best to use the following—
WHERE
orHAVING
How to narrow data even further with subqueries
Using
UNION
to concatenate two results sets before they are returnedThe various ways to join tables, including the difference between a
LEFT JOIN
and aRIGHT JOIN
as well as the differences betweenINNER
joins,OUTER
joins,NATURAL
joins, andCROSS
joins
In the next chapter, we will look at several more of MySQL's powerful functions and how to use them best in Python.