Skip to content

Tested prompt · SQL

Monthly revenue with a running total: every AI model's reply, tested

We sent this hard SQL prompt to all 27 models in llmwise, the same way the app sends a message, and checked every reply the same way. Here's each one as it came, with whether it passed, what it cost and how long it took.

Based on 27 of our test runs on , through OpenRouter with the app's own prompt and settings.

Short answer

All 27 models passed this SQL prompt's check (query result). The cheapest reply that passed was GPT-6 Luna's, at $0.000077; the fastest, Claude Haiku 4.5's in 1.5 s. The dearest reply, Claude Fable 5.1's, cost 332 times as much ($0.0257).

The prompt, as sent, and its check

Checked by query result, the same way for every model.

Monthly revenue with a running total (hard)

[5 lines every SQL prompt of ours shares, word for word: the whole prompt, on the methods page]
For each month of 2026 that has orders that weren't cancelled, show the month as YYYY-MM, that month's revenue in dollars from those orders, and the running total of that revenue from January through that month. Order by month.
Write one SQLite query and reply with it in a ```sql code block.

The query must return the same rows as this one, on the fixture database below, in the same order:

WITH m AS (
  SELECT substr(o.ordered_on, 1, 7) AS month, SUM(oi.quantity * p.price_cents) / 100.0 AS revenue
  FROM orders o
  JOIN order_items oi ON oi.order_id = o.id
  JOIN products p ON p.id = oi.product_id
  WHERE o.status <> 'cancelled' AND o.ordered_on LIKE '2026-%'
  GROUP BY month
)
SELECT month, revenue, SUM(revenue) OVER (ORDER BY month) AS running_total
FROM m
ORDER BY month

Exactly what this prompt's replies are checked against, with every other prompt of our test runs.

Every model's result

All 27 models on this prompt, in catalog order.

Every model's reply to “Monthly revenue with a running total”
ModelResultCostTimeReply
Claude Fable 5.2AnthropicPassed: Returned the right 8 rows.$0.01954.4 s373 tokens
Claude Fable 5.1AnthropicPassed: Returned the right 8 rows.$0.02574.8 s400 tokens
Claude Opus 5.5AnthropicPassed: Returned the right 8 rows.$0.01726.9 s542 tokens
Claude Sonnet 5.5AnthropicPassed: Returned the right 8 rows.$0.00512.6 s390 tokens
Claude Sonnet 5AnthropicPassed: Returned the right 8 rows.$0.00522.6 s246 tokens
Claude Haiku 5.5AnthropicPassed: Returned the right 8 rows.$0.000493.6 s319 tokens
Claude Haiku 4.5AnthropicPassed: Returned the right 8 rows.$0.00171.5 s198 tokens
GPT-6.2 AstraOpenAIPassed: Returned the right 8 rows.$0.01293.6 s185 tokens
GPT-6 AstraOpenAIPassed: Returned the right 8 rows.$0.01016.4 s219 tokens
GPT-6.2 SolOpenAIPassed: Returned the right 8 rows.$0.00383.5 s215 tokens
GPT-6.1 SolOpenAIPassed: Returned the right 8 rows.$0.00363.5 s217 tokens
GPT-6 SolOpenAIPassed: Returned the right 8 rows.$0.00222.7 s196 tokens
GPT-6.1 TerraOpenAIPassed: Returned the right 8 rows.$0.00114.5 s196 tokens
GPT-6 LunaOpenAIPassed: Returned the right 8 rows.$0.0000773.2 s172 tokens
Gemini 4 CarbonGooglePassed: Returned the right 8 rows.$0.005911.6 s230 tokens
Gemini 4 ArgonGooglePassed: Returned the right 8 rows.$0.001910.7 s226 tokens
Gemini 4 HydrogenGooglePassed: Returned the right 8 rows.$0.00577.8 s232 tokens
Gemini 3.1 Pro (preview)GooglePassed: Returned the right 8 rows.$0.00708.8 s170 tokens
Gemini 3.8 FlashGooglePassed: Returned the right 8 rows.$0.000663.0 s201 tokens
DeepSeek V4.1 FlashDeepSeekPassed: Returned the right 8 rows.$0.000731.7 s141 tokens
DeepSeek V4 ProDeepSeekPassed: Returned the right 8 rows.$0.010520.9 s181 tokens
Grok 4.7xAIPassed: Returned the right 8 rows.$0.010716.0 s162 tokens
Kimi K3.1 ProMoonshotPassed: Returned the right 8 rows.$0.00506.3 s199 tokens
Kimi K3MoonshotPassed: Returned the right 8 rows.$0.00404.7 s184 tokens
GLM 5.3Z.aiPassed: Returned the right 8 rows.$0.00172.1 s208 tokens
GLM 5.3 FlashZ.aiPassed: Returned the right 8 rows.$0.000202.9 s153 tokens
Mistral Large 4MistralPassed: Returned the right 8 rows.$0.002719.2 s192 tokens

Cost: what OpenRouter charged us for the reply. Time: from sending to the whole reply. Reply: its length in tokens, thinking not counted. In llmwise you pay per message, not per token: each of these replies counted as one message on Pro.

Every reply

Every reply passed: here they are from the cheapest up.

  1. GPT-6 Luna

    Passed: Returned the right 8 rows.

    ```sql
    WITH monthly_revenue AS (
      SELECT
        strftime('%Y-%m', o.ordered_on) AS month,
        SUM(oi.quantity * p.price_cents) / 100.0 AS revenue
      FROM orders AS o
      JOIN order_items AS oi ON oi.order_id = o.id
      JOIN products AS p ON p.id = oi.product_id
      WHERE o.status <> 'cancelled'
        AND o.ordered_on >= '2026-01-01'
        AND o.ordered_on < '2027-01-01'
      GROUP BY strftime('%Y-%m', o.ordered_on)
    )
    SELECT
      month,
      revenue,
      SUM(revenue) OVER (ORDER BY month) AS running_total
    FROM monthly_revenue
    ORDER BY month;
    ```

    689 tokens in, 172 out · 3.2 s · $0.0001 · 1 message on Pro · answered by openai/gpt-6-luna via OpenAI ·

  2. GLM 5.3 Flash

    Passed: Returned the right 8 rows.

    ```sql
    SELECT
      m.month,
      m.revenue_dollars,
      SUM(m.revenue_dollars) OVER (ORDER BY m.month) AS running_total_dollars
    FROM (
      SELECT
        strftime('%Y-%m', o.ordered_on) AS month,
        ROUND(SUM(oi.quantity * p.price_cents) / 100.0, 2) AS revenue_dollars
      FROM orders o
      JOIN order_items oi ON oi.order_id = o.id
      JOIN products p ON p.id = oi.product_id
      WHERE o.status != 'cancelled'
        AND strftime('%Y', o.ordered_on) = '2026'
      GROUP BY month
    ) m
    ORDER BY m.month;
    ```

    714 tokens in, 186 out (33 of them reasoning) · 2.9 s · $0.0002 · 1 message on Pro · answered by z-ai/glm-5.3-flash via Friendli ·

  3. Claude Haiku 5.5

    Passed: Returned the right 8 rows.

    ```sql
    WITH monthly AS (
        SELECT strftime('%Y-%m', o.ordered_on) AS month,
               SUM(oi.quantity * p.price_cents) AS revenue_cents
        FROM orders o
        JOIN order_items oi ON oi.order_id = o.id
        JOIN products p ON p.id = oi.product_id
        WHERE o.status <> 'cancelled'
          AND strftime('%Y', o.ordered_on) = '2026'
        GROUP BY month
    )
    SELECT month,
           revenue_cents / 100.0 AS revenue,
           SUM(revenue_cents) OVER (ORDER BY month) / 100.0 AS running_total
    FROM monthly
    ORDER BY month;
    ```
    
    This assumes `ordered_on` is stored in a date format SQLite can parse (such as `YYYY-MM-DD`) and that cancelled orders have status `'cancelled'`.

    1,111 tokens in, 860 out (541 of them reasoning) · 3.6 s · $0.0005 · 1 message on Pro · answered by anthropic/claude-haiku-5.5 via Anthropic ·

  4. Gemini 3.8 Flash

    Passed: Returned the right 8 rows.

    ```sql
    WITH monthly_revenue AS (
        SELECT 
            strftime('%Y-%m', o.ordered_on) AS month,
            SUM(oi.quantity * p.price_cents) / 100.0 AS revenue
        FROM orders o
        JOIN order_items oi ON o.id = oi.order_id
        JOIN products p ON oi.product_id = p.id
        WHERE o.ordered_on >= '2026-01-01' 
          AND o.ordered_on < '2027-01-01'
          AND o.status != 'cancelled'
        GROUP BY strftime('%Y-%m', o.ordered_on)
    )
    SELECT 
        month,
        revenue,
        SUM(revenue) OVER (ORDER BY month) AS running_total
    FROM monthly_revenue
    ORDER BY month;
    ```

    761 tokens in, 201 out · 3.0 s · $0.0007 · 1 message on Pro · answered by google/gemini-3.8-flash via Google AI Studio ·

  5. DeepSeek V4.1 Flash

    Passed: Returned the right 8 rows.

    ```sql
    WITH monthly AS (
      SELECT strftime('%Y-%m', o.ordered_on) AS month,
             SUM(oi.quantity * p.price_cents) / 100.0 AS revenue
      FROM orders o
      JOIN order_items oi ON oi.order_id = o.id
      JOIN products p ON p.id = oi.product_id
      WHERE o.status <> 'cancelled'
        AND strftime('%Y', o.ordered_on) = '2026'
      GROUP BY month
    )
    SELECT month,
           revenue,
           SUM(revenue) OVER (ORDER BY month) AS running_total
    FROM monthly
    ORDER BY month;
    ```

    736 tokens in, 549 out (408 of them reasoning) · 1.7 s · $0.0007 · 1 message on Pro · answered by deepseek/deepseek-v4.1-flash via Together ·

  6. GPT-6.1 Terra

    Passed: Returned the right 8 rows.

    ```sql
    WITH monthly AS (
        SELECT
            substr(o.ordered_on, 1, 7) AS month,
            COALESCE(SUM(oi.quantity * p.price_cents), 0) AS revenue_cents
        FROM orders AS o
        LEFT JOIN order_items AS oi ON oi.order_id = o.id
        LEFT JOIN products AS p ON p.id = oi.product_id
        WHERE o.ordered_on >= '2026-01-01'
          AND o.ordered_on < '2027-01-01'
          AND o.status <> 'cancelled'
        GROUP BY substr(o.ordered_on, 1, 7)
    )
    SELECT
        month,
        revenue_cents / 100.0 AS revenue_dollars,
        SUM(revenue_cents) OVER (ORDER BY month) / 100.0 AS running_total_dollars
    FROM monthly
    ORDER BY month;
    ```

    691 tokens in, 293 out (97 of them reasoning) · 4.5 s · $0.0011 · 1 message on Pro · answered by openai/gpt-6.1-terra via OpenAI ·

  7. GLM 5.3

    Passed: Returned the right 8 rows.

    ```sql
    WITH monthly AS (
      SELECT strftime('%Y-%m', o.ordered_on) AS month,
             SUM(oi.quantity * p.price_cents) / 100.0 AS revenue
      FROM orders o
      JOIN order_items oi ON oi.order_id = o.id
      JOIN products p ON p.id = oi.product_id
      WHERE o.status <> 'cancelled'
        AND strftime('%Y', o.ordered_on) = '2026'
      GROUP BY 1
    )
    SELECT month,
           revenue,
           SUM(revenue) OVER (ORDER BY month) AS running_total
    FROM monthly
    ORDER BY month;
    ```
    
    Notes: revenue is computed as quantity × price (in cents) converted to dollars; cancelled orders are excluded; the window function `SUM(...) OVER (ORDER BY month)` gives the running total from January through each month; the CTE filters to 2026, so months with no valid orders simply don't appear.

    713 tokens in, 359 out (151 of them reasoning) · 2.1 s · $0.0017 · 1 message on Pro · answered by z-ai/glm-5.3 via Friendli ·

  8. Claude Haiku 4.5

    Passed: Returned the right 8 rows.

    ```sql
    SELECT
      strftime('%Y-%m', orders.ordered_on) AS month,
      ROUND(SUM(order_items.quantity * products.price_cents) / 100.0, 2) AS revenue,
      ROUND(SUM(SUM(order_items.quantity * products.price_cents)) OVER (ORDER BY strftime('%Y-%m', orders.ordered_on)) / 100.0, 2) AS running_total
    FROM orders
    JOIN order_items ON orders.id = order_items.order_id
    JOIN products ON order_items.product_id = products.id
    WHERE strftime('%Y', orders.ordered_on) = '2026'
      AND orders.status != 'cancelled'
    GROUP BY strftime('%Y-%m', orders.ordered_on)
    ORDER BY month;
    ```

    755 tokens in, 198 out · 1.5 s · $0.0017 · 1 message on Pro · answered by anthropic/claude-haiku-4.5 via Anthropic ·

  9. Gemini 4 Argon

    Passed: Returned the right 8 rows.

    ```sql
    WITH monthly_revenue AS (
        SELECT
            strftime('%Y-%m', o.ordered_on) AS month,
            SUM(oi.quantity * p.price_cents) / 100.0 AS revenue_dollars
        FROM orders o
        JOIN order_items oi ON o.id = oi.order_id
        JOIN products p ON oi.product_id = p.id
        WHERE o.ordered_on >= '2026-01-01'
          AND o.ordered_on < '2027-01-01'
          AND o.status != 'cancelled'
        GROUP BY strftime('%Y-%m', o.ordered_on)
    )
    SELECT
        month,
        revenue_dollars,
        SUM(revenue_dollars) OVER (
            ORDER BY month
            ROWS BETWEEN UNBOUNDED PRECEDING AND CURRENT ROW
        ) AS running_total_dollars
    FROM monthly_revenue
    ORDER BY month;
    ```

    785 tokens in, 226 out · 10.7 s · $0.0019 · 1 message on Pro · answered by google/gemini-4-argon via Google AI Studio ·

  10. GPT-6 Sol

    Passed: Returned the right 8 rows.

    ```sql
    WITH monthly AS (
      SELECT
        substr(o.ordered_on, 1, 7) AS month,
        COALESCE(SUM(oi.quantity * p.price_cents), 0) AS revenue_cents
      FROM orders AS o
      LEFT JOIN order_items AS oi ON oi.order_id = o.id
      LEFT JOIN products AS p ON p.id = oi.product_id
      WHERE o.ordered_on >= '2026-01-01'
        AND o.ordered_on < '2027-01-01'
        AND o.status <> 'cancelled'
      GROUP BY substr(o.ordered_on, 1, 7)
    )
    SELECT
      month,
      revenue_cents / 100.0 AS revenue_dollars,
      SUM(revenue_cents) OVER (ORDER BY month) / 100.0 AS running_total_dollars
    FROM monthly
    ORDER BY month;
    ```

    689 tokens in, 309 out (113 of them reasoning) · 2.7 s · $0.0022 · 1 message on Pro · answered by openai/gpt-6-sol via OpenAI ·

  11. Mistral Large 4

    Passed: Returned the right 8 rows.

    ```sql
    WITH monthly AS (
      SELECT
        strftime('%Y-%m', o.ordered_on) AS month,
        SUM(oi.quantity * p.price_cents) / 100.0 AS revenue_usd
      FROM orders o
      JOIN order_items oi ON oi.order_id = o.id
      JOIN products p ON p.id = oi.product_id
      WHERE o.ordered_on >= '2026-01-01'
        AND o.ordered_on < '2027-01-01'
        AND lower(o.status) <> 'cancelled'
      GROUP BY strftime('%Y-%m', o.ordered_on)
    )
    SELECT
      month,
      ROUND(revenue_usd, 2) AS revenue_usd,
      ROUND(SUM(revenue_usd) OVER (ORDER BY month), 2) AS running_total_usd
    FROM monthly
    ORDER BY month;
    ```

    715 tokens in, 1,100 out (908 of them reasoning) · 19.2 s · $0.0027 · 1 message on Pro · answered by mistralai/mistral-large-4-0 via Mistral ·

  12. GPT-6.1 Sol

    Passed: Returned the right 8 rows.

    ```sql
    WITH monthly_revenue AS (
        SELECT
            strftime('%Y-%m', o.ordered_on) AS month,
            COALESCE(SUM(oi.quantity * p.price_cents), 0) AS revenue_cents
        FROM orders AS o
        LEFT JOIN order_items AS oi ON oi.order_id = o.id
        LEFT JOIN products AS p ON p.id = oi.product_id
        WHERE o.status <> 'cancelled'
          AND o.ordered_on >= '2026-01-01'
          AND o.ordered_on < '2027-01-01'
        GROUP BY strftime('%Y-%m', o.ordered_on)
    )
    SELECT
        month,
        revenue_cents / 100.0 AS revenue_dollars,
        SUM(revenue_cents) OVER (
            ORDER BY month
            ROWS BETWEEN UNBOUNDED PRECEDING AND CURRENT ROW
        ) / 100.0 AS running_revenue_dollars
    FROM monthly_revenue
    ORDER BY month;
    ```

    691 tokens in, 217 out · 3.5 s · $0.0036 · 1 message on Pro · answered by openai/gpt-6.1-sol via OpenAI ·

  13. GPT-6.2 Sol

    Passed: Returned the right 8 rows.

    ```sql
    WITH monthly AS (
        SELECT
            substr(o.ordered_on, 1, 7) AS month,
            COALESCE(SUM(oi.quantity * p.price_cents), 0) AS revenue_cents
        FROM orders AS o
        LEFT JOIN order_items AS oi ON oi.order_id = o.id
        LEFT JOIN products AS p ON p.id = oi.product_id
        WHERE o.ordered_on >= '2026-01-01'
          AND o.ordered_on < '2027-01-01'
          AND o.status <> 'cancelled'
        GROUP BY substr(o.ordered_on, 1, 7)
    )
    SELECT
        month,
        revenue_cents / 100.0 AS revenue_dollars,
        SUM(revenue_cents) OVER (
            ORDER BY month
            ROWS BETWEEN UNBOUNDED PRECEDING AND CURRENT ROW
        ) / 100.0 AS running_revenue_dollars
    FROM monthly
    ORDER BY month;
    ```

    691 tokens in, 237 out (22 of them reasoning) · 3.5 s · $0.0038 · 1 message on Pro · answered by openai/gpt-6.2-sol via OpenAI ·

  14. Kimi K3

    Passed: Returned the right 8 rows.

    ```sql
    SELECT
      strftime('%Y-%m', o.ordered_on) AS month,
      ROUND(SUM(oi.quantity * p.price_cents) / 100.0, 2) AS revenue,
      ROUND(
        SUM(SUM(oi.quantity * p.price_cents))
          OVER (ORDER BY strftime('%Y-%m', o.ordered_on)) / 100.0,
        2
      ) AS running_total
    FROM orders o
    JOIN order_items oi ON oi.order_id = o.id
    JOIN products p ON p.id = oi.product_id
    WHERE o.status <> 'cancelled'
      AND o.ordered_on >= '2026-01-01'
      AND o.ordered_on < '2027-01-01'
    GROUP BY month
    ORDER BY month;
    ```

    780 tokens in, 204 out (20 of them reasoning) · 4.7 s · $0.0040 · 1 message on Pro · answered by moonshotai/kimi-k3 via Together ·

  15. Kimi K3.1 Pro

    Passed: Returned the right 8 rows.

    ```sql
    WITH monthly AS (
        SELECT
            strftime('%Y-%m', o.ordered_on) AS month,
            SUM(oi.quantity * p.price_cents) AS revenue_cents
        FROM orders AS o
        JOIN order_items AS oi ON oi.order_id = o.id
        JOIN products AS p ON p.id = oi.product_id
        WHERE o.ordered_on >= '2026-01-01'
          AND o.ordered_on < '2027-01-01'
          AND o.status <> 'cancelled'
        GROUP BY strftime('%Y-%m', o.ordered_on)
    )
    SELECT
        month,
        revenue_cents / 100.0 AS revenue_dollars,
        SUM(revenue_cents) OVER (ORDER BY month) / 100.0 AS running_total_dollars
    FROM monthly
    ORDER BY month;
    ```

    783 tokens in, 341 out (142 of them reasoning) · 6.3 s · $0.0050 · 1 message on Pro · answered by moonshotai/kimi-k3.1-pro via Together ·

  16. Claude Sonnet 5.5

    Passed: Returned the right 8 rows.

    ```sql
    WITH monthly AS (
      SELECT
        strftime('%Y-%m', o.ordered_on) AS month,
        SUM(oi.quantity * p.price_cents) / 100.0 AS revenue
      FROM orders o
      JOIN order_items oi ON oi.order_id = o.id
      JOIN products p ON p.id = oi.product_id
      WHERE o.status <> 'cancelled'
        AND o.ordered_on >= '2026-01-01'
        AND o.ordered_on < '2027-01-01'
      GROUP BY strftime('%Y-%m', o.ordered_on)
    )
    SELECT
      month,
      revenue,
      SUM(revenue) OVER (ORDER BY month ROWS BETWEEN UNBOUNDED PRECEDING AND CURRENT ROW) AS running_total
    FROM monthly
    ORDER BY month;
    ```
    
    Assumptions: cancelled orders have `status = 'cancelled'`, and `ordered_on` is stored as an ISO date/datetime string. Revenue uses the current `price_cents` in `products`, since the schema has no price at time of order.

    1,112 tokens in, 390 out · 2.6 s · $0.0051 · 1 message on Pro · answered by anthropic/claude-sonnet-5.5 via Anthropic ·

  17. Claude Sonnet 5

    Passed: Returned the right 8 rows.

    ```sql
    SELECT
        month,
        revenue_dollars,
        SUM(revenue_dollars) OVER (ORDER BY month) AS running_total_dollars
    FROM (
        SELECT
            strftime('%Y-%m', o.ordered_on) AS month,
            SUM(oi.quantity * p.price_cents) / 100.0 AS revenue_dollars
        FROM orders o
        JOIN order_items oi ON oi.order_id = o.id
        JOIN products p ON p.id = oi.product_id
        WHERE o.status <> 'cancelled'
          AND strftime('%Y', o.ordered_on) = '2026'
        GROUP BY month
    )
    ORDER BY month;
    ```

    1,108 tokens in, 246 out · 2.6 s · $0.0052 · 1 message on Pro · answered by anthropic/claude-sonnet-5 via Anthropic ·

  18. Gemini 4 Hydrogen

    Passed: Returned the right 8 rows.

    ```sql
    WITH monthly_revenue AS (
        SELECT
            strftime('%Y-%m', o.ordered_on) AS month,
            COALESCE(SUM(oi.quantity * p.price_cents), 0) / 100.0 AS revenue_dollars
        FROM orders o
        LEFT JOIN order_items oi ON oi.order_id = o.id
        LEFT JOIN products p ON p.id = oi.product_id
        WHERE o.ordered_on >= '2026-01-01'
          AND o.ordered_on < '2027-01-01'
          AND o.status != 'cancelled'
        GROUP BY month
    )
    SELECT
        month,
        ROUND(revenue_dollars, 2) AS revenue_dollars,
        ROUND(SUM(revenue_dollars) OVER (ORDER BY month ROWS BETWEEN UNBOUNDED PRECEDING AND CURRENT ROW), 2) AS running_total_dollars
    FROM monthly_revenue
    ORDER BY month;
    ```

    785 tokens in, 1,365 out (1,133 of them reasoning) · 7.8 s · $0.0057 · 1 message on Pro · answered by google/gemini-4-hydrogen via Google AI Studio ·

  19. Gemini 4 Carbon

    Passed: Returned the right 8 rows.

    ```sql
    WITH monthly_cents AS (
        SELECT
            strftime('%Y-%m', o.ordered_on) AS month,
            COALESCE(SUM(oi.quantity * p.price_cents), 0) AS revenue_cents
        FROM orders o
        LEFT JOIN order_items oi ON oi.order_id = o.id
        LEFT JOIN products p ON p.id = oi.product_id
        WHERE strftime('%Y', o.ordered_on) = '2026'
          AND LOWER(o.status) NOT IN ('cancelled', 'canceled')
        GROUP BY strftime('%Y-%m', o.ordered_on)
    )
    SELECT
        month,
        revenue_cents / 100.0 AS monthly_revenue,
        SUM(revenue_cents) OVER (
            ORDER BY month
            ROWS BETWEEN UNBOUNDED PRECEDING AND CURRENT ROW
        ) / 100.0 AS running_total_revenue
    FROM monthly_cents
    ORDER BY month;
    ```

    785 tokens in, 1,020 out (790 of them reasoning) · 11.6 s · $0.0059 · 1 message on Pro · answered by google/gemini-4-carbon via Google AI Studio ·

  20. Gemini 3.1 Pro

    Passed: Returned the right 8 rows.

    ```sql
    WITH monthly_revenue AS (
        SELECT 
            strftime('%Y-%m', o.ordered_on) AS month,
            SUM(p.price_cents * oi.quantity) / 100.0 AS revenue_dollars
        FROM orders o
        JOIN order_items oi ON o.id = oi.order_id
        JOIN products p ON oi.product_id = p.id
        WHERE o.ordered_on LIKE '2026-%' 
          AND o.status != 'cancelled'
        GROUP BY month
    )
    SELECT 
        month, 
        revenue_dollars,
        SUM(revenue_dollars) OVER (ORDER BY month) AS running_total
    FROM monthly_revenue
    ORDER BY month;
    ```

    761 tokens in, 1,042 out (872 of them reasoning) · 8.8 s · $0.0070 · 1 message on Pro · answered by google/gemini-3.1-pro-preview via Google AI Studio ·

  21. GPT-6 Astra

    Passed: Returned the right 8 rows.

    ```sql
    WITH monthly_revenue AS (
        SELECT
            strftime('%Y-%m', o.ordered_on) AS month,
            COALESCE(SUM(oi.quantity * p.price_cents), 0) AS revenue_cents
        FROM orders AS o
        LEFT JOIN order_items AS oi ON oi.order_id = o.id
        LEFT JOIN products AS p ON p.id = oi.product_id
        WHERE o.status <> 'cancelled'
          AND o.ordered_on >= '2026-01-01'
          AND o.ordered_on < '2027-01-01'
        GROUP BY strftime('%Y-%m', o.ordered_on)
    )
    SELECT
        month,
        revenue_cents / 100.0 AS revenue_dollars,
        SUM(revenue_cents) OVER (
            ORDER BY month
            ROWS BETWEEN UNBOUNDED PRECEDING AND CURRENT ROW
        ) / 100.0 AS running_revenue_dollars
    FROM monthly_revenue
    ORDER BY month;
    ```

    689 tokens in, 268 out (49 of them reasoning) · 6.4 s · $0.0101 · 1 message on Pro · answered by openai/gpt-6-astra via OpenAI ·

  22. DeepSeek V4 Pro

    Passed: Returned the right 8 rows.

    ```sql
    WITH monthly_cents AS (
        SELECT substr(o.ordered_on, 1, 7) AS month,
               COALESCE(SUM(p.price_cents * oi.quantity), 0) AS revenue_cents
        FROM orders o
        LEFT JOIN order_items oi ON oi.order_id = o.id
        LEFT JOIN products p ON p.id = oi.product_id
        WHERE substr(o.ordered_on, 1, 4) = '2026'
          AND lower(o.status) <> 'cancelled'
        GROUP BY substr(o.ordered_on, 1, 7)
    )
    SELECT month,
           revenue_cents / 100.0 AS revenue,
           SUM(revenue_cents) OVER (ORDER BY month) / 100.0 AS running_total
    FROM monthly_cents
    ORDER BY month;
    ```

    707 tokens in, 2,492 out (2,311 of them reasoning) · 20.9 s · $0.0105 · 1 message on Pro · answered by deepseek/deepseek-v4-pro-0813 via CoreWeave ·

  23. Grok 4.7

    Passed: Returned the right 8 rows.

    ```sql
    WITH monthly AS (
      SELECT
        strftime('%Y-%m', o.ordered_on) AS month,
        SUM(oi.quantity * p.price_cents) / 100.0 AS revenue
      FROM orders AS o
      JOIN order_items AS oi ON oi.order_id = o.id
      JOIN products AS p ON p.id = oi.product_id
      WHERE o.status != 'cancelled'
        AND strftime('%Y', o.ordered_on) = '2026'
      GROUP BY strftime('%Y-%m', o.ordered_on)
    )
    SELECT
      month,
      revenue,
      SUM(revenue) OVER (ORDER BY month) AS running_total
    FROM monthly
    ORDER BY month;
    ```

    1,936 tokens in, 1,434 out (1,272 of them reasoning) · 16.0 s · $0.0107 · 1 message on Pro · answered by x-ai/grok-4.7 via xAI ·

  24. GPT-6.2 Astra

    Passed: Returned the right 8 rows.

    ```sql
    WITH monthly AS (
        SELECT
            strftime('%Y-%m', o.ordered_on) AS month,
            COALESCE(SUM(oi.quantity * p.price_cents), 0) AS revenue_cents
        FROM orders AS o
        LEFT JOIN order_items AS oi ON oi.order_id = o.id
        LEFT JOIN products AS p ON p.id = oi.product_id
        WHERE o.status <> 'cancelled'
          AND o.ordered_on >= '2026-01-01'
          AND o.ordered_on < '2027-01-01'
        GROUP BY month
    )
    SELECT
        month,
        revenue_cents / 100.0 AS revenue_dollars,
        SUM(revenue_cents) OVER (ORDER BY month) / 100.0 AS running_revenue_dollars
    FROM monthly
    ORDER BY month;
    ```

    691 tokens in, 185 out · 3.6 s · $0.0129 · 1 message on Pro · answered by openai/gpt-6.2-astra via OpenAI ·

  25. Claude Opus 5.5

    Passed: Returned the right 8 rows.

    ```sql
    WITH monthly AS (
      SELECT
        strftime('%Y-%m', o.ordered_on) AS month,
        COALESCE(SUM(oi.quantity * p.price_cents), 0) AS revenue_cents
      FROM orders AS o
      LEFT JOIN order_items AS oi ON oi.order_id = o.id
      LEFT JOIN products AS p ON p.id = oi.product_id
      WHERE o.ordered_on >= '2026-01-01'
        AND o.ordered_on < '2027-01-01'
        AND lower(o.status) <> 'cancelled'
      GROUP BY month
    )
    SELECT
      month,
      ROUND(revenue_cents / 100.0, 2) AS revenue_dollars,
      ROUND(SUM(revenue_cents) OVER (ORDER BY month
            ROWS BETWEEN UNBOUNDED PRECEDING AND CURRENT ROW) / 100.0, 2) AS running_total_dollars
    FROM monthly
    ORDER BY month;
    ```
    
    **Assumptions:**
    - `ordered_on` is stored as ISO text, like `2026-03-15` or `2026-03-15 10:00:00`.
    - A cancelled order has the status `cancelled`. The comparison ignores case.
    - Revenue uses each product's current `price_cents`, because the schema has no price recorded at the time of the order.
    - Totals are added up in cents and only converted to dollars at the end, so no rounding errors build up.
    - A month whose non-cancelled orders have no items still appears, with $0 revenue.

    1,110 tokens in, 741 out (199 of them reasoning) · 6.9 s · $0.0172 · 1 message on Pro · answered by anthropic/claude-opus-5.5 via Azure ·

  26. Claude Fable 5.2

    Passed: Returned the right 8 rows.

    ```sql
    WITH monthly AS (
        SELECT
            strftime('%Y-%m', o.ordered_on) AS month,
            SUM(oi.quantity * p.price_cents) AS revenue_cents
        FROM orders o
        JOIN order_items oi ON oi.order_id = o.id
        JOIN products p ON p.id = oi.product_id
        WHERE o.status <> 'cancelled'
          AND o.ordered_on >= '2026-01-01'
          AND o.ordered_on < '2027-01-01'
        GROUP BY month
    )
    SELECT
        month,
        revenue_cents / 100.0 AS revenue,
        SUM(revenue_cents) OVER (ORDER BY month) / 100.0 AS running_total
    FROM monthly
    ORDER BY month;
    ```
    
    Assumptions: `ordered_on` is stored in ISO format (`YYYY-MM-DD...`), cancelled orders have `status = 'cancelled'` (adjust the literal if your data uses different casing/spelling), and revenue uses current product prices since no price is stored on order items.

    1,110 tokens in, 373 out · 4.4 s · $0.0195 · 1 message on Pro · answered by anthropic/claude-fable-5.2 via Google ·

  27. Claude Fable 5.1

    Passed: Returned the right 8 rows.

    ```sql
    WITH monthly AS (
      SELECT
        strftime('%Y-%m', o.ordered_on) AS month,
        SUM(oi.quantity * p.price_cents) AS revenue_cents
      FROM orders o
      JOIN order_items oi ON oi.order_id = o.id
      JOIN products p ON p.id = oi.product_id
      WHERE o.status <> 'cancelled'
        AND o.ordered_on >= '2026-01-01'
        AND o.ordered_on < '2027-01-01'
      GROUP BY month
    )
    SELECT
      month,
      ROUND(revenue_cents / 100.0, 2) AS revenue_dollars,
      ROUND(SUM(revenue_cents) OVER (ORDER BY month
            ROWS BETWEEN UNBOUNDED PRECEDING AND CURRENT ROW) / 100.0, 2) AS running_total_dollars
    FROM monthly
    ORDER BY month;
    ```
    
    Assumes cancelled orders have `status = 'cancelled'` and `ordered_on` is an ISO date (`YYYY-MM-DD`), as SQLite convention suggests.

    1,110 tokens in, 400 out · 4.8 s · $0.0257 · 1 message on Pro · answered by anthropic/claude-fable-5.1 via Google ·

More SQL prompts

The other SQL prompts, each with every model's reply, and the results across all five.

Questions

Which AI does best on “Monthly revenue with a running total”?

All 27 models passed this SQL prompt's check (query result). The cheapest reply that passed was GPT-6 Luna's, at $0.000077; the fastest, Claude Haiku 4.5's in 1.5 s. The dearest reply, Claude Fable 5.1's, cost 332 times as much ($0.0257).

What does a reply to “Monthly revenue with a running total” cost?

Through the models' APIs, what OpenRouter charged us ran from $0.000077 (GPT-6 Luna) to $0.0257 (Claude Fable 5.1) for this prompt. In llmwise you don't pay by the token: a reply like these counts as one message on Pro, whichever model answers.

Claude, GPT, Gemini, DeepSeek, Grok, Kimi, GLM, and Mistral, in one chat.

See what a message costs before you send it. Every plan is month to month: cancel in two clicks. Sign in with an email link, no password.