Refresher on Aggregates
You will need to know aggregate functions before attempting the other questions.
We would like to find the total weight of cats grouped by age. But only return those groups with a total weight larger than 12.
Return: age, sum(weight) Order by: age Show Table Schema
Correct output but can you use 'group by'?
Group by and Having are required by aggregate functions like sum(). Aggregate functions are used for finding sums and averages. next question
select age, sum(weight) as total_weight from cats group by age having sum(weight) > 12 order by age