SQL execution order doesn't start with SELECT
In a non-image format, the order is:
FROM
/JOIN
and all theON
conditionsWHERE
GROUP BY
HAVING
SELECT
(including window functions)ORDER BY
LIMIT
Source: SQL queries don’t start with SELECT
Handy to have in mind when thinking about performance.