One order arrived as two rows. The join emitted both of them.
The common read: A join attaches the matching row to the row I started with, so the result still has one row per thing I was counting.
Count the rows the roastery's own order table holds for order 1001, then count the rows a join hands back for the same order. Not the same number. The order table holds one row for it, and the join to payments hands back two, because the cafe paid that invoice in two installments and the documentation defines an inner join to produce, for each row of the left input, a row for each row of the right input that satisfies the condition. Two matches, two rows.
Nothing about that is a defect and nothing in the output marks it. Both rows carry the same order_id, the same cafe and the same 640.00, and differ only in the payment columns. The word for how many rows a table holds per real-world thing is grain, this course's word rather than PostgreSQL's: orders is at one row per order, payments at one row per payment, and the joined result at one row per payment that found an order. Nobody wrote that last grain down anywhere.
The tile on the roastery's ops dashboard is labelled orders paid this week and it has been running on this join since the dashboard was built. It is filed under reporting, and it was reviewed by two people who both read the join and neither read the grain.
