Query ready
SELECT c.name, SUM(oi.quantity * p.price) AS revenueFROM customers cJOIN orders o ON o.customer_id = c.idJOIN order_items oi ON oi.order_id = o.idJOIN products p ON p.id = oi.product_idWHERE o.status <> 'cancelled'GROUP BY c.nameORDER BY revenue DESC;
Click any line to inspect its stage
Execution Board
01 · FROM
Scanning every tuple of the relation from working storage before filtering or projection.