Data Aggregationpracticeintermediate
Aggregate Practice
Practice session: GROUP BY, HAVING, and aggregate functions on real data.
Overview
Students reinforce aggregate query skills through independent problem-solving. Tasks progress from simple counts to multi-level grouping with HAVING filters. The instructor circulates and provides targeted help.
Lesson Plan
| Time | Activity |
|---|---|
| 0–10 min | Recap: aggregates and GROUP BY / HAVING |
| 10–20 min | Task explanation — walk through first task together |
| 20–60 min | Hands-on work: students solve tasks independently |
| 60–75 min | Review solutions, discuss optimisation |
| 75–80 min | Wrap-up |
Key Concepts
- Aggregate functions applied to grouped data
- Filtering with HAVING after GROUP BY
- Combining WHERE and HAVING in the same query
- Ordering results by an aggregated value
- Identifying common mistakes: grouping by non-aggregated columns
✏️Practice
Tasks will be provided during the lesson.