CBSE Class 12 Computer Science Question 21 of 44

Solved 2025 Sample Question Paper CBSE Class 12 Computer Science (083) — Question 21

Back to all questions
21
Question

Question 21

Assertion (A): A SELECT command in SQL can have both WHERE and HAVING clauses.

Reasoning (R): WHERE and HAVING clauses are used to check conditions, therefore, these can be used interchangeably.

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

A is true but R is false.

Explanation
A SQL SELECT command can have both WHERE and HAVING clauses. The WHERE clause filters records before any grouping occurs, while the HAVING clause filters records after grouping. Therefore, they cannot be used interchangeably as they operate at different stages of query execution.