Working out revenue
Revenue for an order line is quantity × unit_price in order_items. Join it to the tables you want to slice by, then add it up:
SELECT p.category, SUM(oi.quantity * oi.unit_price) AS revenue
FROM order_items oi
JOIN orders o ON o.id = oi.order_id
JOIN products p ON p.id = oi.product_id
WHERE o.status = 'Completed'
GROUP BY p.categoryOnly completed orders count as revenue: cancelled and returned ones didn't bring money in (or gave it back).
Use unit_price from order_items, not list_price from products. The order line holds the
price actually charged at the time, after any discount; the product's list price is today's.