KnowledgeBoat Logo

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.

  1. Both A and R are true and R is the correct explanation of A.
  2. Both A and R are true but R is not the correct explanation of A.
  3. A is true but R is false.
  4. A is false but R is true.

SQL Queries

1 Like

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.

Answered By

3 Likes