QuestionQ31

VerifiedReporting Aggregated Data Using the Group Functions

Refer to the exhibit and review the structure of the CUSTOMERS table. Consider the following SQL statement:

Question Image

Which statement is true about the result of the preceding query?

Question Image

Explanation

WHERE filters rows whose cust_credit_limit is greater than 1000 before rows are grouped by city. HAVING then filters those city groups based on whether their average credit limit is between 5000 and 6000. BETWEEN is valid in a HAVING clause, and WHERE and HAVING may both be used in the same query, including with the same underlying column.

Community Discussion

No comments yet. Be the first to start the discussion!