


SELECT
product,
SUM(quantity * price) AS total_revenue,
COUNT(*) AS total_orders
FROM sales
GROUP BY product
ORDER BY total_revenue DESC;
SELECT
SUBSTR(order_date, 1, 7) AS order_month,
SUM(quantity * price) AS monthly_revenue
FROM sales
WHERE order_date IS NOT NULL
GROUP BY SUBSTR(order_date, 1, 7)
ORDER BY order_month ASC;
SELECT *
FROM sales
WHERE DATE_PARSE(order_date, '%Y-%m-%d')
BETWEEN DATE '2024-01-01' AND DATE '2024-01-31';