In MySQL, which of the following represents the correct sequence of clauses in…
2026
In MySQL, which of the following represents the correct sequence of clauses in a SELECT query?
- A.
SELECT → FROM → HAVING → ORDER BY → WHERE → GROUP BY
- B.
SELECT → FROM → WHERE → ORDER BY → HAVING → GROUP BY
- C.
SELECT → FROM → HAVING → GROUP BY → WHERE → ORDER BY
- D.
SELECT → FROM → WHERE → GROUP BY → HAVING → ORDER BY
Attempted by 946 students.
Show answer & explanation
Correct answer: D
The correct answer is Option D.
The correct sequence of clauses in a MySQL SELECT query is:
SELECT → FROM → WHERE → GROUP BY → HAVING → ORDER BY
Explanation:
SELECT → specifies columns
FROM → specifies table
WHERE → filters rows
GROUP BY → groups data
HAVING → filters grouped data
ORDER BY → sorts result
Thus, Option D follows the correct order.