Loading

Quipoin Menu

Learn • Practice • Grow

sql / SQL Execution Order
mcq
Direction: Choose the correct option

Q1.

What is the correct SQL execution order?
A. SELECT → FROM → WHERE → ORDER BY
B. FROM → SELECT → WHERE → GROUP BY
C. FROM → WHERE → GROUP BY → HAVING → SELECT → ORDER BY
D. WHERE → FROM → GROUP BY → SELECT
Direction: Choose the correct option

Q2.

SELECT department, COUNT(*) FROM employees WHERE hire_date > '2020-01-01' GROUP BY department HAVING COUNT(*) >= 3 ORDER BY department;
What happens first?
A. FROM and WHERE
B. GROUP BY
C. SELECT
D. ORDER BY
Direction: Choose the correct option

Q3.

Why can't you use column alias in WHERE clause?
A. Aliases are numbers
B. WHERE doesn't support aliases
C. WHERE executes before SELECT
D. SQL syntax doesn't allow
Direction: Choose the correct option

Q4.

SELECT department, AVG(salary) AS avg_sal FROM employees WHERE salary > 30000 GROUP BY department HAVING avg_sal > 50000 ORDER BY avg_sal DESC LIMIT 3;
When is LIMIT applied?
A. Before ORDER BY
B. Last
C. First
D. After SELECT
Direction: Choose the correct option

Q5.

Where does DISTINCT fit in execution order?
A. After ORDER BY
B. During GROUP BY
C. Before FROM
D. After SELECT, before ORDER BY