How SQL Server processes a query

The logical order in which SQL Server parses a query and generates an execution plan:

1. FROM [left_table]

2. ON [join_condition]

3. [join_type] JOIN [right_table]

4. WHERE [where_condition]

5. GROUP BY [group_by_list]

6. WITH { CUBE | ROLLUP }

7. HAVING [having_condition>

8. SELECT

9. DISTINCT [select_list]

10. ORDER BY [order_by_list]

11. [TOP_specification]

The physical order in which SQL Server processes a query:

1. Parsing

2. Binding

3. Query Optimization

4. Query Execution

Views – 555