As a novice SQL, see each unfamiliar keyword is enough to be confused, can often see the sentence keyword order is still various, too difficult to understand. Online search of two articles, summed up:
About SQL keyword Select from GROUP order and so on execution order question explanation
Order of execution of SELECT statements in SQL
And ten steps to fully understand SQL step two.
Summarize:
The parsing order of standard SQL is:
(1). FROM clause, assemble data from different data sources
-
- Includes various join and on
(2). WHERE clause to filter records based on specified criteria
(3). GROUP BY clause, dividing data into multiple groupings
-
- including using aggregate functions for calculations
(4). Use the HAVING clause to filter the grouping
(5). Select Select some columns of the final result
(6). Use order by to sort the result set
Order of execution of keywords in sql