Database Testing / Quiz

Aggregates Don't Lie (Mostly)

GROUP BY, HAVING, and the NULL that turns your reconciliation SUM into a lie. Aggregate queries as a data-quality microscope.

Difficulty
Easy
Format
Quiz
Points
100
Estimate
10 min

// MISSION BRIEF

Your Mission

Counting is the tester's oldest instrument, and SQL gives it teeth. This quiz covers aggregate validation: duplicate hunting with HAVING, WHERE vs HAVING, the empty-SUM trap, and bucketed comparisons that localize where data went wrong.

Scoring: timed quiz; accuracy first, speed bonus for fast clean runs.

// FIRST CONTACT

Battle teaser

To find business keys that appear more than once:

  1. AGROUP BY the key HAVING COUNT(*) > 1
  2. BWHERE COUNT(*) > 1 without grouping
  3. CSELECT DISTINCT and eyeball the result
  4. DORDER BY the key and scroll
Answers, scoring, hints, and the full battle stay sealed.

// SKILL TAGS

sqldatabase-testingaggregatesreconciliation