Lesson 4 · Safe joins

Does joining return events multiply KE-204's revenue?

A one-row-per-order revenue metric joined directly to a one-to-many event table repeats the revenue value once per matching row. Pre-aggregate the event table to one row per order first.

orders

KE-204

recognized revenue · $420

RT-1

inspection

RT-2

approval

RT-3

credit

$420 + $420 + $420 = $1,260

3 × revenue

return_summary

KE-204

3 return events collapsed to 1 row

$420 = $420

1 × revenue

Direct join emphasized. Each of 3 return_events rows repeats the order's $420 revenue, inflating the total to $1,260.