- Getting Data (From, Join)
- Row Filter (Where)
- Grouping (Group by)
- Group Filter (Having)
- Return Expressions (Select)
- Duplicate Filter (Distinct)
- Order & Paging (Order by & Limit / Offset)
IMPORTANT
- In the WHERE clause we cannot use Alias this is because the WHERE clause is executed before the SELECT statement
- In ORDER BY clause we can pass alias as it is processed after the SELECT statement
SQLBolt - Learn SQL - SQL Lesson 12: Order of execution of a Query
The 6 Steps of a SQL Select Statement Process | by Wendy Navarrete