Multiple Aggregations with HAVING

Medium
group-by Netflix DoorDash Spotify

Write a query to find product categories that have at least 3 products and an average rating above 3.5. Return category, product_count, and avg_rating (rounded to 1 decimal), ordered by avg_rating DESC.

Expected Output: Categories meeting both count and rating thresholds.

Tables

Hints (3 available)

SQL Editor

Output

Click "Run" to see results...