Combining data

Pro lesson Beginner

When joins multiply money

Join two tables at different grains and totals quietly inflate. Learn to spot it and fix it.

10 min7 hands-on steps

In this lesson you will

  • See how one row can match many
  • Catch a total that a join has inflated
  • Fix it by aggregating before you join

Words you'll meet

Fan-out
When a join repeats a row once for every match it finds.
Subquery
A query inside parentheses, used as if it were a table.

The steps

Each step teaches one idea, then has you try it hands-on in your browser, and checks your work.

  1. 1Two grains
  2. 2See the fan-out
  3. 3Count the copies
  4. 4The inflated total
  5. 5The rule
  6. 6Aggregate, then join
  7. 7Challenge

This lesson is part of LearnDE Pro

$12 a month or $100 a year: every lesson, spaced-repetition flashcards, and Learn by teaching. Refund on request within 14 days.