QuestionQ18
Analyzing QueriesA data analyst needs to identify product categories that satisfy two conditions:
- Each category has more than 10 products.
- The category’s average product price exceeds $50.
Which SQL statement uses aggregate functions to return only the categories that meet these conditions?
- A SELECT category, COUNT() FROM products GROUP BY category HAVING COUNT() > 10 AND AVG(price) > 50;
- B SELECT category, COUNT() FROM products WHERE COUNT() > 10 GROUP BY category HAVING AVG(price) > 50;
- C SELECT category, COUNT() FROM products HAVING COUNT() > 10 GROUP BY category WHERE AVG(price) > 50;
- D SELECT category, COUNT() FROM products GROUP BY category WHERE COUNT() > 10 AND AVG(price) > 50;
Community Discussion