db.l3.ai

Play

lessons

what-changed-in-19

editor

engine: not started

results

Run a query to see rows here.

check

Boss: fan-out trap

Joining two child tables to one parent multiplies rows: an order with 3 items and 2 payments yields 6 rows, and each sum is inflated. Aggregate each side first, then join.

task

Per customer: item revenue and paid amount, without double counting when joining items and payments.

hints