0 votes
133 views
in Computer Science by (8.5k points)
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.

Mark the correct choice as:

(A) Both A and R are true and R is the correct explanation for A

(B) Both A and R are true and R is not the correct explanation for A

(C) A is True but R is False

(D) A is False but R is True

1 Answer

0 votes
by (56.5k points)
 
Best answer

Correct option is (C) A is True but R is False

A SELECT command in SQL can have both WHERE and HAVING clauses. WHERE and HAVING clauses cannot be used interchangeably.

For example:

SELECT department, COUNT(*)

FROM employees

WHERE salary > 50000

GROUP BY department

HAVING COUNT(*) > 10;

...