How did revenue move month by month in 2024?
Pinned on the demo dashboard as Monthly revenue trend
SELECT strftime(CAST(o.order_date AS TIMESTAMP), '%Y-%m') AS order_month,
ROUND(SUM(o.total_amount), 2) AS revenue
FROM demo_orders o
WHERE o.order_status <> 'cancelled'
GROUP BY 1
ORDER BY 1
LIMIT 24Monthly revenue trend
Drawn from the query result aboveRevenue holds a narrow band across the year: February is the low month at 37,714.84 and September the high at 53,445.30 — about 42% above it. No month runs away from the rest.
What the model wrote when we asked it the same question
gemini-3.1-flash-lite · 19 August 2026 · shown as a plan you approve before it runsWhat it said it was going to do: “I'll calculate the total monthly revenue for 2024 by summing the order amounts and grouping them by month.”
If you do not read SQL, that sentence plus “What came back” and “Where it differs from ours” further down are your check — here and under every chart below, you can run this whole comparison without opening a single query block. We should say the harder half of that out loud: “you can read the SQL and refuse it” is not a guarantee you can use if SQL is not a language you read, and most people who need this tool most cannot. What is left for you is narrower and still real — a stated intention, the numbers it returned, and a named difference from a query a human wrote. Be clear about where that stops: the differences below are visible without reading any SQL, because they show up in the totals and in which product names make the list. The reasons for them are not. We had to read the queries to find out why, and if that step matters to you and you cannot take it, then this is a job you want a person who reads SQL to check once — not a reason to trust the answer more.
SELECT
strftime(order_date::DATE, '%Y-%m') AS month,
ROUND(SUM(total_amount), 2) AS total_revenue
FROM demo_orders_1a2b3c
WHERE order_date BETWEEN '2024-01-01' AND '2024-12-31'
GROUP BY 1
ORDER BY 1 ASCWhat came back: Ran. Twelve rows, one per month, and the same shape as ours — February the low month, September the high one.
Where it differs from ours: Every month comes back higher. The year totals 597,387.69 against our 570,211.28: 27,176.41 more, which is exactly the value of the 155 cancelled orders our query excludes and its query does not. Add AND order_status <> 'cancelled' to the model's query, change nothing else, and all twelve months match ours to the cent. One further thing we saw asking this three times: in one run the model left the ::DATE cast out, and that query does not run at all — DuckDB refuses strftime on a text column with “Could not choose a best candidate function”. The cast this page explains further down is not a stylistic detail; it is the difference between a chart and an error.