MOO WebTech
Data Aggregationpracticeintermediate

Aggregate Practice

Practice session: GROUP BY, HAVING, and aggregate functions on real data.

80 minL30

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

TimeActivity
0–10 minRecap: aggregates and GROUP BY / HAVING
10–20 minTask explanation — walk through first task together
20–60 minHands-on work: students solve tasks independently
60–75 minReview solutions, discuss optimisation
75–80 minWrap-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.