TOPIC 08/3015 MINNOT STARTED

Totals in plain words: count, SUM (add up), AVG (average), MIN (smallest) and MAX (largest)

Learn the five total functions one at a time, what each does with missing values, what they return on an empty table, and how to check a total against a count you trust.

L1–L4 are part of the Pro pass

L0 Explain simply

Analogy: a kitchen tally. You can count the jars, add their weights, or find the lightest and the heaviest. An empty shelf is not a weight of zero. A missing label is not a jar you weighed.

Daily List is a made-up to-do app (SYNTHETIC / TRAINING ONLY). Sam, the , totals minutes on tasks. Nina, the , asks for the average. One task has no minutes written down.

What it is: (Structured Query Language) is a language for asking a database questions. A table is a grid, a row is one task, and a column is one fact. A reduces many values to one, such as COUNT, SUM, AVG, MIN or MAX. A total of no rows is what those functions return when the filter matches nothing. Nulls skipped by totals means SUM, AVG, MIN and MAX ignore null, while COUNT(*) still counts the row. You use them in a query. The neighbour of COUNT(*) is COUNT(column), which skips nulls.

Why it matters: Treating a blank as zero changes the average from 15 to 11.25. Sam needs Nina to say what a blank minute means before he fills it in.

Four jars are easy to add. The same skip-the-blank rule still applies when the shelf is long.

PLAIN WORDS · 1 in this section
heaviest
the largest in effect

PICTURE IT

The picture is the one the lesson above opens with. The table below shows how each part of it matches the work.

THE REAL JOB An end-of-day till roll that skips voided lines.

  1. Pick
  2. Run
  3. Check
Till roll

HOW THE PICTURE MAPS

How each part of the picture matches the work
In the pictureIn the work
The count of salescount star
The money totalSUM
The average saleAVG
A voided lineA null

WHERE THIS PICTURE STOPS

  • A till roll is printed once, but a query can run again.
  • A shop knows a void on sight, but a null is silent.
  • A till has a few lines, but a table can have millions.

HOOK

Blanks are skipped.

TELL A FRIEND

A till roll: voided lines are skipped.

OFTEN MIXED UP WITH SQL for BAs: NULL and missing values. That topic explains null. This one shows how null changes each total.

PRACTISE AND KEEP

Sources for this topic — 4 sources
  1. Market practice

    Aggregate functions (PostgreSQL documentation) ↗ — PostgreSQL · PostgreSQL 18, §9.21 aggregates, NULL and empty input; publisher page opened6November 2026. Dialect scope explicit.

    §9.21 aggregates, NULL and empty input. PostgreSQL18 implementation, not a universal SQL mandate. · Checked 2026-11-06

    PostgreSQL18 publisher documentation opened on6November2026: §9.21 aggregates, NULL and empty input. No execution on PostgreSQL is claimed; engine-specific examples remain scoped to18.

  2. Market practice

    SQLite: built-in aggregate functions ↗ — SQLite project · SQLite: built-in aggregate functions; NULL/empty aggregate results; SQLite numeric/text coercion. Publisher page opened6November 2026.

    NULL/empty aggregate results; SQLite numeric/text coercion. · Checked 2026-11-06

    Publisher documentation opened on6November2026. Engine/version scope is explicit; other database implementations may differ. Teaching queries are synthetic, not a required publisher template.

  3. Market practice

    SQL Server ver17: AVG return types ↗ — Microsoft · SQL Server ver17: AVG return types; AVG(int) returns int; exact versus approximate numeric return categories. Publisher page opened6November 2026.

    AVG(int) returns int; exact versus approximate numeric return categories. · Checked 2026-11-06

    Publisher documentation opened on6November2026. Engine/version scope is explicit; other database implementations may differ. Teaching queries are synthetic, not a required publisher template.

  4. Simplified educational illustration

    Payments Signal editorial teaching models — Payments Signal

    This site's own simplified teaching models. · Checked 2026-07-12

    What this simplifies: Daily List people, data and exercises are invented for teaching. Query results belong to the declared fixture and database version. Authorization, business identity, time bounds and unknown-value policy must be agreed in context; no universal mandatory query template is implied.

    Used wherever diagrams, scenarios, figures, or example values are didactic constructions rather than sourced facts; every such use carries a simplifications disclosure. All people, companies, banks, and list entries in examples are fictional.

Deepest material on this page: L4 — Standards & sources. Where a topic stops short of implementation depth, that is a deliberate coverage decision, not an oversight — see coverage.