Plate 01
Plum Robe Field Notes
LegendaryThe printouts on the floor are yours. I emptied the folder onto the rug. The table had dinner on it and the dinner was staying where it was. The robe is not a statement. The flat is cold. Page one is the LEFT JOIN where you put the filter in the WHERE. You asked for every customer and their shipped orders and you got two customers. Bruno and Dmitri are still customers. They have been customers this whole time. I have marked it. I am not sending it tonight. You would only fix it badly at midnight.
Margin note
Your LEFT JOIN quietly became an INNER JOIN
SELECT c.name, COUNT(o.order_id) AS shipped_orders
FROM customers c
LEFT JOIN orders o ON o.customer_id = c.customer_id
WHERE o.status = 'shipped'
GROUP BY c.name
ORDER BY c.name;
WHERE runs after the join and judges every row it produced, not only the NULL-filled ones. Bruno’s cancelled order fails o.status = ‘shipped’ outright; Dmitri’s NULL-filled row fails it because NULL = ‘shipped’ is UNKNOWN. Both leave a report that asked for every customer. Put the predicate in the ON clause and both come back with a count of 0.
Executed against DuckDB 1.5.3-r.3, 2026-09-05 · companion file: tsumugi-companion.sql