The following query is done for oracle's HR schema. I would like to know step by step which instruction gets executed first and most of all, which SELECT
statement is evaluated first.
SELECT name, salary, dept_id
FROM employee
WHERE salary >
( SELECT AVG(salary) FROM employee
WHERE dept_no =
(SELECT dept_no FROM employee
WHERE last_name =
( SELECT last_name FROM employee
WHERE salary > 50000))) ;
PS: I know that this query may not be valid, but that's not the point. What I would like to know is the order in which the instructions would be executed.