Question 85

Given the following two statements about SQL. (A) An SQL query can contain HAVING clause only if it has GROUP BY clause.

Given the following two statements about SQL. (A) An SQL query can contain HAVING clause only if it has GROUP BY clause. (B) In an SQL query "SELECT_FROM_WHERE_GROUP BY_HAVING". HAVING is executed before WHERE. Which of the following is correct?
  1. A(A) and (B) both are true
  2. B(A) is true, (B) is false
  3. C(A) is false, (B) is true
  4. D(A) and (B) both are false
Show answerHide answer

Correct answer: (D) (A) and (B) both are false

Explanation

Corrected: the book's key says (b). HAVING can be used without GROUP BY (the whole result is one group), and WHERE is applied before HAVING, so both statements are false.

From DSSSB TGT Computer Science Practice Set 3

This is question 85 of DSSSB TGT Computer Science Practice Set 3. See all questions of this paper with answers, or attempt the paper as a timed online test to get your score and all-India rank.