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?

  1. A.

    SELECT → FROM → HAVING → ORDER BY → WHERE → GROUP BY

  2. B.

    SELECT → FROM → WHERE → ORDER BY → HAVING → GROUP BY

  3. C.

    SELECT → FROM → HAVING → GROUP BY → WHERE → ORDER BY

  4. 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.

Explore the full course: Up Lt Grade Assistant Teacher 2025