I hope I ask this question correctly
I'm attempting to get a better understand of the order results / result sets are returned during the execution of tsql scripts inside stored procedures.
What I'm wanting to understand is when a said stored procedure has many joins and then is followed by the WHERE, ORDER BY, HAVING, nested table queries, ect.. what order are the joins and nested table queries are executed and where the results are stored while the other queries are being executed, what triggers other queries to be executed.
In other words what queries are executed first, where is the results of the queries stored until needed by outer queries, an what triggers the outer queries to execute.
I do not know how to properly has this question so I am not able to Google this question correctly.
I need an explanation of this at a 1st grade level, and then I need an explanation at the graduation level, as in simple explanation first then with this educated foundation I will need to move up to the more in-depth explanation.
**I not expecting someone to type the answer for this complex question, if someone can provide with with links that already has this documentation that would be a god send.
Thank for the help ahead of time.
Erik