- Home
- Class - 12 CBSE Computer Science — Assertion Reason Type Questions
Assertion (A): GROUP BY clause is always
Class - 12 CBSE Computer Science — Assertion Reason Type Questions
Assertion (A): GROUP BY clause is always preceded by ORDER BY clause in a SELECT statement.
Reasoning (R): ORDER BY clause always follows other clauses.
- Both A and R are true and R is the correct explanation of A.
- Both A and R are true but R is not the correct explanation of A.
- A is true but R is false.
- A is false but R is true.
Answer
Both A and R are true and R is the correct explanation of A.
Explanation
In SQL syntax, the GROUP BY
clause comes before the ORDER BY
clause. The standard order of clauses is SELECT, FROM, WHERE, GROUP BY, HAVING, and ORDER BY. On the other hand, it is true that the ORDER BY
clause always follows other clauses, as it comes after the other clauses in the statement.