QuestionQ94

VerifiedReporting Aggregated Data Using the Group Functions

Refer to the exhibit and review the structure of the customers table.

Question Image

Using the customers table, you must generate a report showing the average credit limit for customers in Washington and NEW YORK. Which SQL statement produces the required result?

Question Image

Explanation

To return an average credit limit for each requested city, the query must filter to Washington and NEW YORK, apply AVG to cust_credit_limit, and group by cust_city. AVG excludes null values; grouping by the credit-limit column would split each city into multiple groups instead of producing one average per city.

Community Discussion

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