Aggregate functions answer the questions that actually matter in business: "How many orders came in last month? What is the average salary per department? Which product category drives the most revenue?"
What you'll learn
COUNT(*)for total rows,COUNT(col)to skip NULLsSUMandAVGon numeric columnsMINandMAXto find extremesGROUP BY— collapse rows that share a value into one summary rowHAVING— filter on the aggregated result (not the raw rows)- Stack aggregates with
WHERE,ORDER BY, andLIMIT COUNT(DISTINCT col)to count unique values
What you'll practice on
The Store database (orders, products, categories) and the HR database. You'll build queries like "revenue by product category" and "headcount per department sorted by average salary."
Prerequisites
SQL Fundamentals + Filtering & Logic.