Computer Science · A3.3 Database Programming

A3.3.4 — Calculations with SQL Aggregate Functions

Preview

IB DP Computer Science — A3 Databases — Database programming | HL | A3.3.4

📋 What You Will Learn

  • Construct calculations with the five aggregate functions: COUNT, SUM, AVG (average), MAX, MIN
  • Group rows with GROUP BY so aggregates are computed per group
  • Filter groups with HAVING, and distinguish it from WHERE
  • Trace the logical order WHERE → GROUP BY → aggregate → HAVING → ORDER BY
  • Deduce exact aggregate results from given data, as used for reporting and decision-making

📊 Why This Matters A head of department doesn't want 7 000 grade rows — they want "average grade per subject" on one slide. Aggregate functions collapse many rows into the few numbers people actually decide with, and they do it inside the database, so only the summary travels to the report.

The

Continue reading the full note