sqlintermediate

Aggregate - Technique 20

Aggregate functions

sql
SELECT category,
       COUNT(*) AS product_count,
       SUM(stock) AS total_stock,
       AVG(price) AS avg_price
FROM products
GROUP BY category
HAVING COUNT(*) > 3;

Use Cases

  • database operations
  • data management

Tags

Related Snippets

Similar patterns you can reuse in the same workflow.