Agent-ready data marts
Part 1 of 3 in What an AI needs from company data
On 40 SQL questions written alongside the documentation, two current models missed an average of 3.3 to 5 from a bare schema and almost none with it, near the ceiling: 28 were right in every arm
Three models answered the same 40 questions about a synthetic banking ledger, with the same tables and SQL interface in every arm. Within each model, documentation raised the score, but the gain rests on the 12 questions the current models did not always get right, and every interval is wider than its gain. For Claude Opus 5.5, a plain list of allowed values recovered most of it (7.5 of 8.3 points); full documentation added 0.8 on top. Without documentation the current models mostly asked what a metric meant or hedged, and the rubric counts both as misses.
| Claude Sonnet 5.5, 3 runs+11.7 ppfull documentation against the bare schema (interval +2.5 to +21.7); bare, allowed values, documentation: 35/40, 37/40, 39.7/40 | Claude Opus 5.5, 3 runs+8.3 ppinterval +2.5 to +15.0; 36.7/40, 39.7/40, 40/40, with 3 answers cut off at the output ceiling left out (counted as wrong: 36/40 bare, +10.0 pp) | gpt-4.1-mini, one run+15.0 ppinterval 0.0 to +30.0, which reaches zero; 27/40, 31/39, 33/40, with 1 request the provider failed left out (counted as wrong: 31/40); documentation fixed 8 answers and broke 2 |
Main limitation The study wrote the 40 questions, their answer key and the documentation together, so the documentation states the conventions the key scores; the AI answers over company data study reuses these questions byte for byte. Synthetic data, one SQL answer per question without querying the data first, three runs for the current models and one for gpt-4.1-mini: the intervals describe this question set and support no general claim about documentation. | ||
Next part: agents that use tools under a role on the same data, with the rules in the prompt or enforced by the tools.
Correct answers out of 40 per arm. The current models show the mean of three runs; gpt-4.1-mini ran once.
Every value and its table are in the full chart under Current models.
Two current models: documentation helps each, from a higher start
Two current models, claude-sonnet-5-5 and claude-opus-5-5, were added after the first results. Each answered the same 40 questions in all three arms, three times, with the same prompts, sandbox and scoring. Their protocol was frozen before the first scored request; three practice questions ran first to confirm the settings and are excluded from every score.
Correct answers out of 40 per arm. The current models show the mean of three runs; gpt-4.1-mini ran once.
Show the data
| Model | Runs | Bare schema, mean | Bare schema, each run | Schema plus allowed values, mean | Schema plus allowed values, each run | Full documentation, mean | Full documentation, each run | Documentation minus bare, pp | Interval, pp |
|---|---|---|---|---|---|---|---|---|---|
| gpt-4.1-mini | 1 | 27 | 27 | 31 | 31 | 33 | 33 | +15.0 | 0.0 to +30.0 |
| Claude Sonnet 5.5 | 3 | 35 | 35, 35, 35 | 37 | 37, 37, 37 | 39.7 | 40, 40, 39 | +11.7 | +2.5 to +21.7 |
| Claude Opus 5.5 | 3 | 36 | 37, 37, 34 | 39.3 | 39, 40, 39 | 40 | 40, 40, 40 | +10.0 | +4.2 to +17.5 |
| Model | Comparison | Mean correct, first arm | Mean correct, second arm | Difference | Interval, lower | Interval, upper | Twin-clustered, lower | Twin-clustered, upper | Questions better | Questions worse |
|---|---|---|---|---|---|---|---|---|---|---|
| Claude Sonnet 5.5 | Full documentation minus bare schema | 39.666666666666664 | 35.0 | 0.11666666666666667 | 0.025 | 0.21666666666666665 | 0.017094017094017092 | 0.24786324786324784 | 5 | 0 |
| Claude Sonnet 5.5 | Schema plus allowed values minus bare schema | 37.0 | 35.0 | 0.05 | 0.0 | 0.125 | 0.0 | 0.13157894736842105 | 2 | 0 |
| Claude Sonnet 5.5 | Full documentation minus schema plus allowed values | 39.666666666666664 | 37.0 | 0.06666666666666667 | 0.0 | 0.15 | 0.0 | 0.18333333333333332 | 3 | 0 |
| Claude Opus 5.5 | Full documentation minus bare schema | 40.0 | 36.0 | 0.1 | 0.04166666666666667 | 0.17500000000000002 | 0.03174603174603175 | 0.1842105263157895 | 8 | 0 |
| Claude Opus 5.5 | Schema plus allowed values minus bare schema | 39.333333333333336 | 36.0 | 0.08333333333333334 | 0.025 | 0.15000000000000002 | 0.01666666666666667 | 0.16666666666666669 | 8 | 1 |
| Claude Opus 5.5 | Full documentation minus schema plus allowed values | 40.0 | 39.333333333333336 | 0.01666666666666667 | 0.0 | 0.04166666666666667 | 0.0 | 0.04385964912280702 | 2 | 0 |
Download results-models.json · Download summary-models.csv · All 720 outcomes as CSV
Source: results-models.json and results-three-arm.json; 10,000 bootstrap resamples, seed 7.
- Full documentation beat the bare schema by 11.7 points for Claude Sonnet 5.5 (interval +2.5 to +21.7) and 10.0 for Claude Opus 5.5 (interval +4.2 to +17.5), against 15.0 for gpt-4.1-mini (interval 0.0 to +30.0). The current models start higher, and at this size their gains cannot be told apart from gpt-4.1-mini's.
- Allowed values alone reached 39.3 for Claude Opus 5.5, 8.3 of its 10.0 points, but 37 for Claude Sonnet 5.5, 5.0 of 11.7. Given only the value lists, Sonnet defined net external cash flow as deposits minus withdrawals in all six of its answers to those two questions; the bundle defines it as every posted credit minus every posted debit outside transfers, purchases and refunds included. That reading is common, and the answer key scores it wrong because I wrote the key with the bundle.
- With the bare schema, over three runs, Claude Sonnet 5.5 asked for a metric definition on an answerable question 8 times, used category values that do not exist 4 times (event_kind = 'internal_transfer', status = 'completed') and answered a clarification question with SQL 3 times. Claude Opus 5.5 asked for a definition 5 times, wrapped category columns in LOWER(), which the allowed function list excludes, 5 times, and ran out of its output ceiling while thinking 2 times (3 times across all arms; these are failures of the setup, which the key figures leave out and this section counts as misses). In one denied query it also listed spellings that do not exist, such as 'in' and 'inbound', beside 'credit'.
- The frozen rubric counts a request for a definition as a miss, because these questions are analytical. The bare schema leaves terms such as deposit or net external cash flow undefined, and that is the gap the documentation fills.
- On the 4 clarification questions, gpt-4.1-mini asked correctly in no arm. Claude Opus 5.5 asked correctly in 12 of 12 tries with the bare schema and 12 of 12 with documentation; Claude Sonnet 5.5 in 9 of 12 and 11 of 12. The tries are repeats of only four questions, so they support no broader conclusion about asking for clarification.
- Runs differed for Claude Opus 5.5 with the bare schema (37, 37, 34 correct; 8 questions answered differently between runs). With full documentation Opus answered all 40 correctly in every run and Sonnet 40, 40, 39.
- Claude Sonnet 5.5 ran with thinking limited to between tool calls and no tools offered, so it did not think. Claude Opus 5.5 accepts neither that setting nor disabled thinking, so it used its default adaptive thinking, which appeared in 203 of its 360 responses and counts toward the same 800-token output ceiling.
- The response format also differs: gpt-4.1-mini had JSON-object mode, the current models a schema that allows only the two answer shapes, so they could not return an answer in the wrong shape, though an answer cut off at the output ceiling still fails. Read the documentation effect within each model; across models the comparison is descriptive.
Where the gain came from for gpt-4.1-mini
Paired differences in percentage points (pp) on 40 questions, each with the question-level bootstrap interval and a twin-clustered interval that resamples the CAD and USD versions of a question together.
Show the data
| Comparison | Correct, first arm | Correct, second arm | Difference | Interval, lower | Interval, upper | Twin-clustered, lower | Twin-clustered, upper | Fixed | Broken |
|---|---|---|---|---|---|---|---|---|---|
| Full documentation minus bare schema | 33 | 27 | 0.1499999999999999 | 0.0 | 0.3 | 0.0 | 0.3142857142857143 | 8 | 2 |
| Schema plus allowed values minus bare schema | 31 | 27 | 0.09999999999999998 | 0.0 | 0.225 | −0.02564102564102564 | 0.24324324324324326 | 5 | 1 |
| Full documentation minus schema plus allowed values | 33 | 31 | 0.04999999999999993 | −0.075 | 0.175 | −0.075 | 0.175 | 4 | 2 |
Download results-three-arm.json · Download summary-three-arm.csv
Source: results-three-arm.json, comparisons; 10,000 bootstrap resamples, seed 7.
- Against the bare schema, allowed values fixed 5 answers and broke 1; full documentation fixed 8 and broke 2.
- Eight questions come as CAD and USD twins that tend to succeed or fail together. Resampling each pair as one unit gives the dashed intervals. This check was added after the first results were seen.
- One allowed-values request failed at the provider. Left out instead of scored wrong, allowed values scored 31 of 39, and the two allowed-values comparisons become +10.3 and +5.1 points (results-sensitivity.json).
Why gpt-4.1-mini answers were wrong
The bare schema guessed category values that do not exist in 6 of its 9 wrong analytical answers (direction = 'inbound', direction = 'outbound', event_kind = 'external', status = 'completed'). With the value lists, no answer guessed a value. Using occurred_at instead of the posting date remained in 3 answers with allowed values and in none with full documentation, which defines the posting rule. Each arm made one grain error.
| Cause | Bare schema | Schema plus allowed values | Full documentation |
|---|---|---|---|
| Guessed a category value that does not exist | 6 | 0 | 0 |
| Used occurred_at for a posted-period question | 7 | 3 | 0 |
| Wrong grain (duplicated rows or a stock summed across dates) | 1 | 1 | 1 |
| Other definition error | 1 | 2 | 0 |
| SQL failed to run | 0 | 1 | 2 |
| Incorrect analytical answers | 9 | 5 | 3 |
Every incorrect analytical answer and its cause
| Question | Arm | Causes | What went wrong |
|---|---|---|---|
| How many CAD purchase events contributed to July 2026 card spend? Return one count. | Bare | used occurred_at for a posted-period question | Counted purchase events by the month of occurred_at instead of the posted spend date. |
| How many distinct CAD purchases received at least one refund during July 2026? Return one count, including purchases from earlier periods. | Bare | used occurred_at for a posted-period question, other definition error | Treated purchases as credits and refunds as debits, so the join matched nothing, and filtered refunds by occurred_at. |
| What was the deposit amount in CAD during July 2026? Return one amount in minor units. | Bare | guessed a category value that does not exist, used occurred_at for a posted-period question | Filtered direction = 'inbound', a value that does not exist, and used occurred_at for the period. |
| What was the deposit amount in USD during July 2026? Return one amount in minor units. | Bare | guessed a category value that does not exist, used occurred_at for a posted-period question | Filtered direction = 'inbound', a value that does not exist, and used occurred_at for the period. |
| What was the withdrawal amount in CAD during July 2026? Return one amount in minor units. | Bare | guessed a category value that does not exist, used occurred_at for a posted-period question | Filtered direction = 'outbound', a value that does not exist, and used occurred_at for the period. |
| What was net external cash flow in CAD during July 2026? Return one signed amount in minor units. | Bare | guessed a category value that does not exist, used occurred_at for a posted-period question | Used direction 'inbound' and event_kind 'external', neither of which exists, and used occurred_at for the period. |
| What was net external cash flow in CAD during July 2026? Return one signed amount in minor units. | Documentation | sql failed to run | Joined accounts with USING, then filtered an ambiguous currency column; the query failed. |
| What was net external cash flow in USD during July 2026? Return one signed amount in minor units. | Bare | guessed a category value that does not exist, used occurred_at for a posted-period question | Used direction 'inbound' and event_kind 'external', neither of which exists, and used occurred_at for the period. |
| What was internal transfer volume in CAD during July 2026? Count each transfer once. Return one amount in minor units. | Documentation | sql failed to run | Referenced a column through an alias that was not defined in that scope; the query failed. |
| How many internal transfers completed during July 2026, by currency? Count each transfer once. Return currency and transfer count. | Bare | guessed a category value that does not exist | Filtered status = 'completed'; the posted value is 'posted', so no rows matched. |
| Which CAD accounts had no purchases contributing to July 2026 card spend? Return account_id, including accounts with other ledger activity. | Documentation | wrong grain (duplicated rows or a stock summed across dates) | Joined cards before card spend, so an account with two cards and no July purchases was listed twice. |
| Reconcile July 2026 ledger balances by currency. Return currency, opening balance at July 1, total signed posted movement during July, and closing balance at July 31. Use minor units and include all accounts. | Bare | wrong grain (duplicated rows or a stock summed across dates) | Summed opening and closing balances over all 31 days of July instead of taking July 1 and July 31. |
| How many CAD purchase events contributed to July 2026 card spend? Return one count. | Allowed values | used occurred_at for a posted-period question | Counted purchase events by the month of occurred_at instead of the posted spend date. |
| At the snapshot, how many active cards are there in each account currency? Return currency and active-card count, retaining currencies with no active cards. | Allowed values | sql failed to run | Used UNION ALL, which the prompt does not allow; the validator denied the query. |
| What was net external cash flow in CAD during July 2026? Return one signed amount in minor units. | Allowed values | used occurred_at for a posted-period question, other definition error | Counted deposits, withdrawals and transfers as external cash flow, left out purchases and refunds, and used occurred_at for the period. |
| What was net external cash flow in USD during July 2026? Return one signed amount in minor units. | Allowed values | used occurred_at for a posted-period question, other definition error | Counted only deposits and withdrawals as external cash flow, left out purchases and refunds, and used occurred_at for the period. |
| Reconcile July 2026 ledger balances by currency. Return currency, opening balance at July 1, total signed posted movement during July, and closing balance at July 31. Use minor units and include all accounts. | Allowed values | wrong grain (duplicated rows or a stock summed across dates) | Took the minimum opening and maximum closing daily balance across accounts instead of summing July 1 opening and July 31 closing. |
By question type, gpt-4.1-mini
| Question type | Questions | Bare schema | Schema plus allowed values | Full documentation |
|---|---|---|---|---|
| All questions | 40 | 27 | 31 | 33 |
| Analytical SQL | 36 | 27 | 31 | 33 |
| Clarification | 4 | 0 | 0 | 0 |
No arm passed a clarification question. Three were answered with SQL instead of a question. On the fourth, about high-risk accounts, the bare and allowed-values arms asked for the wrong definitions and the documented arm used a label the answer format does not allow. One allowed-values request failed at the provider (HTTP 503). That is a failure of the setup, not a wrong answer: the key figures leave it out, and this table counts it as incorrect, as declared. It was a clarification question the other arms also missed.
How EXISTS is scored
The SQL check treats EXISTS and NOT EXISTS as the ordinary subqueries the prompt allows, and still checks the tables, functions and recursion inside them; this rule was set after the results. The declared check, the unchanged evaluator archive 0.1.0, denies them as functions.
The rule changes one answer, with the bare schema: "Which CAD accounts had no purchases contributing to July 2026 card spend? Return account_id, including accounts with other ledger activity." Its NOT EXISTS query returns the expected accounts in the sandbox, so it counts as correct.
Under the declared check the bare schema has 26/40 instead of 27/40, and the documentation gain is +17.5 points (interval +5.0 to +32.5) instead of +15.0 (interval 0.0 to +30.0). Both scorings are in the download: results-corrected.json and results.json.
What each arm received
- Bare schema: the answer rules, the allowed SQL functions, and table and column names with their types.
- Schema plus allowed values: the same, plus one list of the distinct values of every text column that is not an identifier, read from the database: currencies, account and card statuses, category names and groups, event kinds, posting statuses and directions. Nothing else. The exact list.
- Full documentation: the bare schema plus a bundle that names the allowed values of the status, event kind, direction and currency columns and defines metrics, table grain, currency, posting time, refunds, transfers and safe joins. The exact bundle.
Three examples from the bundle, chosen before any answers were seen
- Posting time: financial periods follow posted_at, even when the initiating event happened in another month.
- Balance grain: a daily account balance must not repeat when an account has several cards.
- Refunds and transfers: refunds reduce spend when they post; internal transfers move money between accounts and are not spend.
These examples illustrate the bundle. Apart from the declared allowed-values arm, no ablation measures what any single part of it contributes.
Every question and answer
Open a question to compare the three gpt-4.1-mini responses, the rows each query returned and the expected answer, with how many of their three runs each current model answered correctly. Their 720 outcomes are in question-outcomes-models.csv. Responses are shown as text; this page runs no SQL and calls no model.
What was gross card spend in CAD during July 2026? Return one amount in minor units.Bare: correct · Allowed values: correct · Documentation: correct
Rubric: analytical SQL. Expected columns: amount_minor. Row order not scored.
Bare schema
correct
Model response
{"kind":"sql","sql":"SELECT SUM(purchased_minor) FROM card_spend_daily WHERE currency = 'CAD' AND spend_date >= DATE '2026-07-01' AND spend_date < DATE '2026-08-01'"}Executed rows
[[1342646]]
Schema plus allowed values
correct
Model response
{"kind":"sql","sql":"SELECT SUM(purchased_minor) FROM card_spend_daily WHERE currency = 'CAD' AND spend_date >= DATE '2026-07-01' AND spend_date < DATE '2026-08-01'"}Executed rows
[[1342646]]
Full documentation
correct
Model response
{"kind":"sql","sql":"SELECT COALESCE(SUM(purchased_minor), 0) AS gross_card_spend_cad_july_2026 FROM card_spend_daily WHERE currency = 'CAD' AND spend_date >= DATE '2026-07-01' AND spend_date < DATE '2026-08-01'"}Executed rows
[[1342646]]
Current models, correct runs
| Model | Bare schema | Schema plus allowed values | Full documentation |
|---|---|---|---|
| Claude Sonnet 5.5 | 3 of 3 | 3 of 3 | 3 of 3 |
| Claude Opus 5.5 | 3 of 3 | 3 of 3 | 3 of 3 |
Expected result
[[1342646]]
Gold SQL
SELECT COALESCE(SUM(purchased_minor),0) FROM card_spend_daily WHERE spend_date >= DATE '2026-07-01' AND spend_date < DATE '2026-08-01' AND currency='CAD'
What was gross card spend in USD during July 2026? Return one amount in minor units.Bare: correct · Allowed values: correct · Documentation: correct
Rubric: analytical SQL. Expected columns: amount_minor. Row order not scored.
Bare schema
correct
Model response
{"kind":"sql","sql":"SELECT SUM(purchased_minor) FROM card_spend_daily WHERE currency = 'USD' AND spend_date >= DATE '2026-07-01' AND spend_date < DATE '2026-08-01'"}Executed rows
[[580559]]
Schema plus allowed values
correct
Model response
{"kind":"sql","sql":"SELECT SUM(purchased_minor) FROM card_spend_daily WHERE currency = 'USD' AND spend_date >= DATE '2026-07-01' AND spend_date < DATE '2026-08-01'"}Executed rows
[[580559]]
Full documentation
correct
Model response
{"kind":"sql","sql":"SELECT COALESCE(SUM(purchased_minor), 0) AS gross_card_spend_usd_july_2026\nFROM card_spend_daily\nJOIN cards ON card_spend_daily.card_id = cards.card_id\nJOIN accounts ON cards.account_id = accounts.account_id\nWHERE card_spend_daily.spend_date >= DATE '2026-07-01'\n AND card_spend_daily.spend_date < DATE '2026-08-01'\n AND accounts.currency = 'USD'"}Executed rows
[[580559]]
Current models, correct runs
| Model | Bare schema | Schema plus allowed values | Full documentation |
|---|---|---|---|
| Claude Sonnet 5.5 | 3 of 3 | 3 of 3 | 3 of 3 |
| Claude Opus 5.5 | 3 of 3 | 3 of 3 | 3 of 3 |
Expected result
[[580559]]
Gold SQL
SELECT COALESCE(SUM(purchased_minor),0) FROM card_spend_daily WHERE spend_date >= DATE '2026-07-01' AND spend_date < DATE '2026-08-01' AND currency='USD'
What was the refunded card amount in CAD during July 2026? Return one amount in minor units.Bare: correct · Allowed values: correct · Documentation: correct
Rubric: analytical SQL. Expected columns: amount_minor. Row order not scored.
Bare schema
correct
Model response
{"kind":"sql","sql":"SELECT COALESCE(SUM(refunded_minor), 0) FROM card_spend_daily WHERE currency = 'CAD' AND spend_date >= DATE '2026-07-01' AND spend_date < DATE '2026-08-01'"}Executed rows
[[64654]]
Schema plus allowed values
correct
Model response
{"kind":"sql","sql":"SELECT COALESCE(SUM(refunded_minor), 0) AS refunded_amount_minor FROM card_spend_daily WHERE currency = 'CAD' AND spend_date >= DATE '2026-07-01' AND spend_date < DATE '2026-08-01'"}Executed rows
[[64654]]
Full documentation
correct
Model response
{"kind":"sql","sql":"SELECT COALESCE(SUM(refunded_minor), 0) AS refunded_amount_cad FROM card_spend_daily WHERE currency = 'CAD' AND spend_date >= DATE '2026-07-01' AND spend_date < DATE '2026-08-01'"}Executed rows
[[64654]]
Current models, correct runs
| Model | Bare schema | Schema plus allowed values | Full documentation |
|---|---|---|---|
| Claude Sonnet 5.5 | 3 of 3 | 3 of 3 | 3 of 3 |
| Claude Opus 5.5 | 3 of 3 | 3 of 3 | 3 of 3 |
Expected result
[[64654]]
Gold SQL
SELECT COALESCE(SUM(refunded_minor),0) FROM card_spend_daily WHERE spend_date >= DATE '2026-07-01' AND spend_date < DATE '2026-08-01' AND currency='CAD'
What was net card spend in CAD during July 2026? Return one amount in minor units.Bare: correct · Allowed values: correct · Documentation: correct
Rubric: analytical SQL. Expected columns: amount_minor. Row order not scored.
Bare schema
correct
Model response
{"kind":"sql","sql":"SELECT COALESCE(SUM(net_spend_minor), 0) AS net_card_spend_cad_july_2026 FROM card_spend_daily WHERE currency = 'CAD' AND spend_date >= DATE '2026-07-01' AND spend_date < DATE '2026-08-01'"}Executed rows
[[1277992]]
Schema plus allowed values
correct
Model response
{"kind":"sql","sql":"SELECT COALESCE(SUM(net_spend_minor), 0) AS net_card_spend_cad_july_2026 FROM card_spend_daily WHERE currency = 'CAD' AND spend_date >= DATE '2026-07-01' AND spend_date < DATE '2026-08-01'"}Executed rows
[[1277992]]
Full documentation
correct
Model response
{"kind":"sql","sql":"SELECT COALESCE(SUM(net_spend_minor), 0) AS net_card_spend_cad FROM card_spend_daily WHERE currency = 'CAD' AND spend_date >= DATE '2026-07-01' AND spend_date < DATE '2026-08-01'"}Executed rows
[[1277992]]
Current models, correct runs
| Model | Bare schema | Schema plus allowed values | Full documentation |
|---|---|---|---|
| Claude Sonnet 5.5 | 3 of 3 | 3 of 3 | 3 of 3 |
| Claude Opus 5.5 | 3 of 3 | 3 of 3 | 3 of 3 |
Expected result
[[1277992]]
Gold SQL
SELECT COALESCE(SUM(net_spend_minor),0) FROM card_spend_daily WHERE spend_date >= DATE '2026-07-01' AND spend_date < DATE '2026-08-01' AND currency='CAD'
What was net card spend in USD during July 2026? Return one amount in minor units.Bare: correct · Allowed values: correct · Documentation: correct
Rubric: analytical SQL. Expected columns: amount_minor. Row order not scored.
Bare schema
correct
Model response
{"kind":"sql","sql":"SELECT COALESCE(SUM(net_spend_minor), 0) AS net_card_spend_usd_july_2026 FROM card_spend_daily WHERE currency = 'USD' AND spend_date >= DATE '2026-07-01' AND spend_date < DATE '2026-08-01'"}Executed rows
[[554332]]
Schema plus allowed values
correct
Model response
{"kind":"sql","sql":"SELECT COALESCE(SUM(net_spend_minor), 0) AS net_card_spend_usd_july_2026 FROM card_spend_daily WHERE currency = 'USD' AND spend_date >= DATE '2026-07-01' AND spend_date < DATE '2026-08-01'"}Executed rows
[[554332]]
Full documentation
correct
Model response
{"kind":"sql","sql":"SELECT COALESCE(SUM(net_spend_minor), 0) AS net_card_spend_usd_july_2026\nFROM card_spend_daily\nWHERE currency = 'USD'\n AND spend_date >= DATE '2026-07-01'\n AND spend_date < DATE '2026-08-01'"}Executed rows
[[554332]]
Current models, correct runs
| Model | Bare schema | Schema plus allowed values | Full documentation |
|---|---|---|---|
| Claude Sonnet 5.5 | 3 of 3 | 3 of 3 | 3 of 3 |
| Claude Opus 5.5 | 3 of 3 | 3 of 3 | 3 of 3 |
Expected result
[[554332]]
Gold SQL
SELECT COALESCE(SUM(net_spend_minor),0) FROM card_spend_daily WHERE spend_date >= DATE '2026-07-01' AND spend_date < DATE '2026-08-01' AND currency='USD'
How many CAD purchase events contributed to July 2026 card spend? Return one count.Bare: wrong answer · Allowed values: wrong answer · Documentation: correct
Rubric: analytical SQL. Expected columns: purchase_count. Row order not scored.
Bare schema
wrong answer
Model response
{"kind":"sql","sql":"SELECT COUNT(*) FROM transactions WHERE currency = 'CAD' AND event_kind = 'purchase' AND EXTRACT(YEAR FROM occurred_at) = 2026 AND EXTRACT(MONTH FROM occurred_at) = 7"}Executed rows
[[342]]
Schema plus allowed values
wrong answer
Model response
{"kind":"sql","sql":"SELECT COUNT(*) FROM transactions WHERE event_kind = 'purchase' AND currency = 'CAD' AND EXTRACT(YEAR FROM occurred_at) = 2026 AND EXTRACT(MONTH FROM occurred_at) = 7"}Executed rows
[[342]]
Full documentation
correct
Model response
{"kind":"sql","sql":"SELECT COUNT(*) FROM transactions WHERE event_kind = 'purchase' AND status = 'posted' AND currency = 'CAD' AND posted_at >= '2026-07-01' AND posted_at < '2026-08-01' AND card_id IS NOT NULL"}Executed rows
[[286]]
Current models, correct runs
| Model | Bare schema | Schema plus allowed values | Full documentation |
|---|---|---|---|
| Claude Sonnet 5.5 | 3 of 3 | 3 of 3 | 3 of 3 |
| Claude Opus 5.5 | 3 of 3 | 3 of 3 | 3 of 3 |
Expected result
[[286]]
Gold SQL
SELECT COALESCE(SUM(purchase_count),0) FROM card_spend_daily WHERE spend_date >= DATE '2026-07-01' AND spend_date < DATE '2026-08-01' AND currency='CAD'
Break down July 2026 net card spend in CAD by category label, including the uncategorized bucket. Return category label and net minor units for categories with activity.Bare: correct · Allowed values: correct · Documentation: correct
Rubric: analytical SQL. Expected columns: category, net_minor. Row order not scored.
Bare schema
correct
Model response
{"kind":"sql","sql":"SELECT COALESCE(c.category_name, 'Uncategorized') AS category_label, SUM(cs.net_spend_minor) AS net_minor_units FROM card_spend_daily cs LEFT JOIN categories c ON cs.category_id = c.category_id WHERE cs.currency = 'CAD' AND cs.spend_date >= DATE '2026-07-01' AND cs.spend_date < DATE '2026-08-01' GROUP BY category_label HAVING SUM(cs.net_spend_minor) <> 0"}Executed rows
[["Software", 224575], ["Travel", 249615], ["Supplies", 219068], ["Meals", 293557], ["Uncategorized", 291177]]
Schema plus allowed values
correct
Model response
{"kind":"sql","sql":"SELECT COALESCE(c.category_name, 'Uncategorized') AS category_label, SUM(cs.net_spend_minor) AS net_minor_units\nFROM card_spend_daily cs\nLEFT JOIN categories c ON cs.category_id = c.category_id\nWHERE cs.currency = 'CAD' AND EXTRACT(YEAR FROM cs.spend_date) = 2026 AND EXTRACT(MONTH FROM cs.spend_date) = 7\nGROUP BY category_label\nHAVING SUM(cs.net_spend_minor) != 0"}Executed rows
[["Software", 224575], ["Travel", 249615], ["Supplies", 219068], ["Meals", 293557], ["Uncategorized", 291177]]
Full documentation
correct
Model response
{"kind":"sql","sql":"SELECT COALESCE(c.category_name, 'Uncategorized') AS category_label, SUM(cs.net_spend_minor) AS net_minor_units\nFROM card_spend_daily cs\nLEFT JOIN categories c ON cs.category_id = c.category_id\nWHERE cs.currency = 'CAD' AND cs.spend_date >= DATE '2026-07-01' AND cs.spend_date < DATE '2026-08-01'\nGROUP BY category_label\nHAVING SUM(cs.net_spend_minor) != 0"}Executed rows
[["Software", 224575], ["Travel", 249615], ["Supplies", 219068], ["Meals", 293557], ["Uncategorized", 291177]]
Current models, correct runs
| Model | Bare schema | Schema plus allowed values | Full documentation |
|---|---|---|---|
| Claude Sonnet 5.5 | 3 of 3 | 3 of 3 | 3 of 3 |
| Claude Opus 5.5 | 3 of 3 | 3 of 3 | 3 of 3 |
Expected result
[["Software", 224575], ["Travel", 249615], ["Supplies", 219068], ["Meals", 293557], ["Uncategorized", 291177]]
Gold SQL
SELECT COALESCE(c.category_name,'Uncategorized'), SUM(s.net_spend_minor) FROM card_spend_daily s LEFT JOIN categories c ON s.category_id=c.category_id WHERE spend_date >= DATE '2026-07-01' AND spend_date < DATE '2026-08-01' AND s.currency='CAD' GROUP BY COALESCE(c.category_name,'Uncategorized')
Break down July 2026 net card spend in USD by category label, including the uncategorized bucket. Return category label and net minor units for categories with activity.Bare: correct · Allowed values: correct · Documentation: correct
Rubric: analytical SQL. Expected columns: category, net_minor. Row order not scored.
Bare schema
correct
Model response
{"kind":"sql","sql":"SELECT COALESCE(c.category_name, 'Uncategorized') AS category_label, SUM(cs.net_spend_minor) AS net_minor_units\nFROM card_spend_daily cs\nLEFT JOIN categories c ON cs.category_id = c.category_id\nWHERE cs.currency = 'USD' AND cs.spend_date >= DATE '2026-07-01' AND cs.spend_date < DATE '2026-08-01'\nGROUP BY category_label\nHAVING SUM(cs.net_spend_minor) <> 0"}Executed rows
[["Meals", 111588], ["Travel", 117967], ["Software", 101312], ["Supplies", 94490], ["Uncategorized", 128975]]
Schema plus allowed values
correct
Model response
{"kind":"sql","sql":"SELECT COALESCE(c.category_name, 'Uncategorized') AS category_label, SUM(cs.net_spend_minor) AS net_minor_units\nFROM card_spend_daily cs\nLEFT JOIN categories c ON cs.category_id = c.category_id\nWHERE cs.currency = 'USD' AND EXTRACT(YEAR FROM cs.spend_date) = 2026 AND EXTRACT(MONTH FROM cs.spend_date) = 7\nGROUP BY category_label\nHAVING SUM(cs.net_spend_minor) != 0"}Executed rows
[["Meals", 111588], ["Travel", 117967], ["Software", 101312], ["Supplies", 94490], ["Uncategorized", 128975]]
Full documentation
correct
Model response
{"kind":"sql","sql":"SELECT COALESCE(c.category_name, 'Uncategorized') AS category_label, SUM(cs.net_spend_minor) AS net_minor_units\nFROM card_spend_daily cs\nLEFT JOIN categories c ON cs.category_id = c.category_id\nJOIN cards cd ON cs.card_id = cd.card_id\nJOIN accounts a ON cd.account_id = a.account_id\nWHERE cs.spend_date >= DATE '2026-07-01' AND cs.spend_date < DATE '2026-08-01' AND a.currency = 'USD'\nGROUP BY category_label\nHAVING SUM(cs.net_spend_minor) != 0"}Executed rows
[["Meals", 111588], ["Travel", 117967], ["Software", 101312], ["Supplies", 94490], ["Uncategorized", 128975]]
Current models, correct runs
| Model | Bare schema | Schema plus allowed values | Full documentation |
|---|---|---|---|
| Claude Sonnet 5.5 | 3 of 3 | 3 of 3 | 3 of 3 |
| Claude Opus 5.5 | 3 of 3 | 3 of 3 | 3 of 3 |
Expected result
[["Meals", 111588], ["Travel", 117967], ["Software", 101312], ["Supplies", 94490], ["Uncategorized", 128975]]
Gold SQL
SELECT COALESCE(c.category_name,'Uncategorized'), SUM(s.net_spend_minor) FROM card_spend_daily s LEFT JOIN categories c ON s.category_id=c.category_id WHERE spend_date >= DATE '2026-07-01' AND spend_date < DATE '2026-08-01' AND s.currency='USD' GROUP BY COALESCE(c.category_name,'Uncategorized')
Break down July 2026 net card spend in CAD by organization. Return organization_id and net minor units for organizations with card activity.Bare: correct · Allowed values: correct · Documentation: correct
Rubric: analytical SQL. Expected columns: organization_id, net_minor. Row order not scored.
Bare schema
correct
Model response
{"kind":"sql","sql":"SELECT a.organization_id, SUM(csd.net_spend_minor) AS net_spend_minor\nFROM card_spend_daily csd\nJOIN accounts a ON csd.account_id = a.account_id\nWHERE csd.currency = 'CAD'\n AND csd.spend_date >= DATE '2026-07-01'\n AND csd.spend_date < DATE '2026-08-01'\nGROUP BY a.organization_id\nHAVING SUM(csd.net_spend_minor) != 0"}Executed rows
[["org_01", 230735], ["org_02", 203006], ["org_03", 253869], ["org_04", 250691], ["org_05", 243071], ["org_06", 96620]]
Schema plus allowed values
correct
Model response
{"kind":"sql","sql":"SELECT a.organization_id, SUM(csd.net_spend_minor) AS net_spend_minor\nFROM card_spend_daily csd\nJOIN accounts a ON csd.account_id = a.account_id\nWHERE csd.currency = 'CAD'\n AND csd.spend_date >= DATE '2026-07-01'\n AND csd.spend_date < DATE '2026-08-01'\nGROUP BY a.organization_id\nHAVING SUM(csd.net_spend_minor) != 0"}Executed rows
[["org_01", 230735], ["org_02", 203006], ["org_03", 253869], ["org_04", 250691], ["org_05", 243071], ["org_06", 96620]]
Full documentation
correct
Model response
{"kind":"sql","sql":"SELECT a.organization_id, SUM(csd.net_spend_minor) AS net_spend_minor\nFROM card_spend_daily csd\nJOIN cards c ON csd.card_id = c.card_id\nJOIN accounts a ON c.account_id = a.account_id\nWHERE csd.spend_date >= DATE '2026-07-01' AND csd.spend_date < DATE '2026-08-01'\n AND csd.currency = 'CAD'\nGROUP BY a.organization_id\nHAVING SUM(csd.purchase_count) > 0"}Executed rows
[["org_01", 230735], ["org_02", 203006], ["org_03", 253869], ["org_04", 250691], ["org_05", 243071], ["org_06", 96620]]
Current models, correct runs
| Model | Bare schema | Schema plus allowed values | Full documentation |
|---|---|---|---|
| Claude Sonnet 5.5 | 3 of 3 | 3 of 3 | 3 of 3 |
| Claude Opus 5.5 | 3 of 3 | 3 of 3 | 3 of 3 |
Expected result
[["org_01", 230735], ["org_02", 203006], ["org_03", 253869], ["org_04", 250691], ["org_05", 243071], ["org_06", 96620]]
Gold SQL
SELECT a.organization_id,SUM(s.net_spend_minor) FROM card_spend_daily s JOIN accounts a ON s.account_id=a.account_id WHERE spend_date >= DATE '2026-07-01' AND spend_date < DATE '2026-08-01' AND s.currency='CAD' GROUP BY a.organization_id
Break down July 2026 net card spend in USD by organization. Return organization_id and net minor units for organizations with card activity.Bare: correct · Allowed values: correct · Documentation: correct
Rubric: analytical SQL. Expected columns: organization_id, net_minor. Row order not scored.
Bare schema
correct
Model response
{"kind":"sql","sql":"SELECT a.organization_id, SUM(csd.net_spend_minor) AS net_spend_minor\nFROM card_spend_daily csd\nJOIN accounts a ON csd.account_id = a.account_id\nWHERE csd.currency = 'USD'\n AND csd.spend_date >= DATE '2026-07-01'\n AND csd.spend_date < DATE '2026-08-01'\nGROUP BY a.organization_id\nHAVING SUM(csd.net_spend_minor) != 0"}Executed rows
[["org_01", 106600], ["org_02", 127490], ["org_03", 88313], ["org_05", 127957], ["org_04", 103972]]
Schema plus allowed values
correct
Model response
{"kind":"sql","sql":"SELECT a.organization_id, SUM(csd.net_spend_minor) AS net_spend_minor\nFROM card_spend_daily csd\nJOIN accounts a ON csd.account_id = a.account_id\nWHERE csd.currency = 'USD'\n AND csd.spend_date >= DATE '2026-07-01'\n AND csd.spend_date < DATE '2026-08-01'\nGROUP BY a.organization_id\nHAVING SUM(csd.net_spend_minor) != 0"}Executed rows
[["org_01", 106600], ["org_02", 127490], ["org_03", 88313], ["org_05", 127957], ["org_04", 103972]]
Full documentation
correct
Model response
{"kind":"sql","sql":"SELECT a.organization_id, SUM(csd.net_spend_minor) AS net_spend_minor\nFROM card_spend_daily csd\nJOIN cards c ON csd.card_id = c.card_id\nJOIN accounts a ON c.account_id = a.account_id\nWHERE csd.spend_date >= DATE '2026-07-01' AND csd.spend_date < DATE '2026-08-01'\n AND csd.currency = 'USD'\nGROUP BY a.organization_id\nHAVING SUM(csd.purchase_count) > 0"}Executed rows
[["org_01", 106600], ["org_02", 127490], ["org_03", 88313], ["org_05", 127957], ["org_04", 103972]]
Current models, correct runs
| Model | Bare schema | Schema plus allowed values | Full documentation |
|---|---|---|---|
| Claude Sonnet 5.5 | 3 of 3 | 3 of 3 | 3 of 3 |
| Claude Opus 5.5 | 3 of 3 | 3 of 3 | 3 of 3 |
Expected result
[["org_01", 106600], ["org_02", 127490], ["org_03", 88313], ["org_05", 127957], ["org_04", 103972]]
Gold SQL
SELECT a.organization_id,SUM(s.net_spend_minor) FROM card_spend_daily s JOIN accounts a ON s.account_id=a.account_id WHERE spend_date >= DATE '2026-07-01' AND spend_date < DATE '2026-08-01' AND s.currency='USD' GROUP BY a.organization_id
For every CAD account, including zero-spend accounts, show July 2026 net card spend. Return account_id and net minor units.Bare: correct · Allowed values: correct · Documentation: correct
Rubric: analytical SQL. Expected columns: account_id, net_minor. Row order not scored.
Bare schema
correct
Model response
{"kind":"sql","sql":"SELECT a.account_id, COALESCE(SUM(csd.net_spend_minor), 0) AS net_minor_units\nFROM accounts a\nLEFT JOIN card_spend_daily csd ON a.account_id = csd.account_id AND csd.currency = 'CAD' AND csd.spend_date >= DATE '2026-07-01' AND csd.spend_date <= DATE '2026-07-31'\nWHERE a.currency = 'CAD'\nGROUP BY a.account_id"}Executed rows
[["acct_001", 129813], ["acct_002", 100922], ["acct_004", 106104], ["acct_005", 96902], ["acct_007", 130636], ["acct_008", 123233], ["acct_011", 126577], ["acct_013", 120981], ["acct_014", 122090], ["acct_016", 96620], ["acct_010", 124114], ["acct_019", 0], ["acct_017", 0]]
Schema plus allowed values
correct
Model response
{"kind":"sql","sql":"SELECT a.account_id, COALESCE(SUM(csd.net_spend_minor), 0) AS net_spend_minor\nFROM accounts a\nLEFT JOIN card_spend_daily csd ON a.account_id = csd.account_id\n AND csd.currency = 'CAD'\n AND csd.spend_date >= DATE '2026-07-01' AND csd.spend_date <= DATE '2026-07-31'\nWHERE a.currency = 'CAD'\nGROUP BY a.account_id"}Executed rows
[["acct_001", 129813], ["acct_002", 100922], ["acct_004", 106104], ["acct_005", 96902], ["acct_007", 130636], ["acct_008", 123233], ["acct_011", 126577], ["acct_013", 120981], ["acct_014", 122090], ["acct_016", 96620], ["acct_010", 124114], ["acct_019", 0], ["acct_017", 0]]
Full documentation
correct
Model response
{"kind":"sql","sql":"SELECT a.account_id, COALESCE(SUM(csd.net_spend_minor), 0) AS net_card_spend_minor\nFROM accounts a\nLEFT JOIN cards c ON a.account_id = c.account_id\nLEFT JOIN card_spend_daily csd ON c.card_id = csd.card_id AND csd.spend_date >= DATE '2026-07-01' AND csd.spend_date < DATE '2026-08-01'\nWHERE a.currency = 'CAD'\nGROUP BY a.account_id"}Executed rows
[["acct_001", 129813], ["acct_002", 100922], ["acct_004", 106104], ["acct_005", 96902], ["acct_007", 130636], ["acct_008", 123233], ["acct_011", 126577], ["acct_013", 120981], ["acct_014", 122090], ["acct_016", 96620], ["acct_010", 124114], ["acct_017", 0], ["acct_019", 0]]
Current models, correct runs
| Model | Bare schema | Schema plus allowed values | Full documentation |
|---|---|---|---|
| Claude Sonnet 5.5 | 3 of 3 | 3 of 3 | 3 of 3 |
| Claude Opus 5.5 | 3 of 3 | 3 of 3 | 3 of 3 |
Expected result
[["acct_001", 129813], ["acct_002", 100922], ["acct_004", 106104], ["acct_005", 96902], ["acct_007", 130636], ["acct_008", 123233], ["acct_011", 126577], ["acct_013", 120981], ["acct_014", 122090], ["acct_016", 96620], ["acct_010", 124114], ["acct_019", 0], ["acct_017", 0]]
Gold SQL
SELECT a.account_id,COALESCE(SUM(s.net_spend_minor),0) FROM accounts a LEFT JOIN card_spend_daily s ON a.account_id=s.account_id AND s.spend_date >= DATE '2026-07-01' AND spend_date < DATE '2026-08-01' WHERE a.currency='CAD' GROUP BY a.account_id
For every USD account, including zero-spend accounts, show July 2026 net card spend. Return account_id and net minor units.Bare: correct · Allowed values: correct · Documentation: correct
Rubric: analytical SQL. Expected columns: account_id, net_minor. Row order not scored.
Bare schema
correct
Model response
{"kind":"sql","sql":"SELECT a.account_id, COALESCE(SUM(csd.net_spend_minor), 0) AS net_spend_minor\nFROM accounts a\nLEFT JOIN card_spend_daily csd ON a.account_id = csd.account_id AND csd.currency = 'USD' AND csd.spend_date >= DATE '2026-07-01' AND csd.spend_date <= DATE '2026-07-31'\nWHERE a.currency = 'USD'\nGROUP BY a.account_id"}Executed rows
[["acct_003", 106600], ["acct_006", 127490], ["acct_009", 88313], ["acct_015", 127957], ["acct_012", 103972], ["acct_018", 0]]
Schema plus allowed values
correct
Model response
{"kind":"sql","sql":"SELECT a.account_id, COALESCE(SUM(csd.net_spend_minor), 0) AS net_spend_minor\nFROM accounts a\nLEFT JOIN card_spend_daily csd ON a.account_id = csd.account_id\n AND csd.currency = 'USD'\n AND csd.spend_date >= DATE '2026-07-01' AND csd.spend_date <= DATE '2026-07-31'\nWHERE a.currency = 'USD'\nGROUP BY a.account_id"}Executed rows
[["acct_003", 106600], ["acct_006", 127490], ["acct_009", 88313], ["acct_015", 127957], ["acct_012", 103972], ["acct_018", 0]]
Full documentation
correct
Model response
{"kind":"sql","sql":"SELECT a.account_id, COALESCE(SUM(csd.net_spend_minor), 0) AS net_card_spend_minor\nFROM accounts a\nLEFT JOIN cards c ON a.account_id = c.account_id\nLEFT JOIN card_spend_daily csd ON c.card_id = csd.card_id AND csd.spend_date >= DATE '2026-07-01' AND csd.spend_date < DATE '2026-08-01'\nWHERE a.currency = 'USD'\nGROUP BY a.account_id"}Executed rows
[["acct_003", 106600], ["acct_006", 127490], ["acct_009", 88313], ["acct_015", 127957], ["acct_012", 103972], ["acct_018", 0]]
Current models, correct runs
| Model | Bare schema | Schema plus allowed values | Full documentation |
|---|---|---|---|
| Claude Sonnet 5.5 | 3 of 3 | 3 of 3 | 3 of 3 |
| Claude Opus 5.5 | 3 of 3 | 3 of 3 | 3 of 3 |
Expected result
[["acct_003", 106600], ["acct_006", 127490], ["acct_009", 88313], ["acct_015", 127957], ["acct_012", 103972], ["acct_018", 0]]
Gold SQL
SELECT a.account_id,COALESCE(SUM(s.net_spend_minor),0) FROM accounts a LEFT JOIN card_spend_daily s ON a.account_id=s.account_id AND s.spend_date >= DATE '2026-07-01' AND spend_date < DATE '2026-08-01' WHERE a.currency='USD' GROUP BY a.account_id
Show daily CAD net card spend during July 2026, only dates with card activity, in chronological order. Return UTC date as YYYY-MM-DD and net minor units.Bare: correct · Allowed values: correct · Documentation: correct
Rubric: analytical SQL. Expected columns: date, net_minor. Row order required.
Bare schema
correct
Model response
{"kind":"sql","sql":"SELECT STRFTIME(spend_date, '%Y-%m-%d') AS date, SUM(net_spend_minor) AS net_spend_minor FROM card_spend_daily WHERE currency = 'CAD' AND spend_date >= DATE '2026-07-01' AND spend_date < DATE '2026-08-01' GROUP BY spend_date ORDER BY spend_date ASC"}Executed rows
[["2026-07-01", 66420], ["2026-07-02", 48706], ["2026-07-03", 29351], ["2026-07-04", 43817], ["2026-07-05", 25257], ["2026-07-06", 47767], ["2026-07-07", 54913], ["2026-07-08", 37942], ["2026-07-09", 37747], ["2026-07-10", 42269], ["2026-07-11", 58518], ["2026-07-12", 27667], ["2026-07-13", 52979], ["2026-07-14", 49789], ["2026-07-15", 25343], ["2026-07-16", 29279], ["2026-07-17", 41628], ["2026-07-18", 46129], ["2026-07-19", 34962], ["2026-07-20", 43742], ["2026-07-21", 40948], ["2026-07-22", 45552], ["2026-07-23", 26826], ["2026-07-24", 49751], ["2026-07-25", 30147], ["2026-07-26", 34592], ["2026-07-27", 61314], ["2026-07-28", 38322], ["2026-07-29", 37432], ["2026-07-30", 30821], ["2026-07-31", 38062]]
Schema plus allowed values
correct
Model response
{"kind":"sql","sql":"SELECT STRFTIME(spend_date, '%Y-%m-%d') AS date, SUM(net_spend_minor) AS net_spend_minor\nFROM card_spend_daily\nWHERE currency = 'CAD' AND spend_date >= DATE '2026-07-01' AND spend_date < DATE '2026-08-01'\nGROUP BY spend_date\nORDER BY spend_date ASC"}Executed rows
[["2026-07-01", 66420], ["2026-07-02", 48706], ["2026-07-03", 29351], ["2026-07-04", 43817], ["2026-07-05", 25257], ["2026-07-06", 47767], ["2026-07-07", 54913], ["2026-07-08", 37942], ["2026-07-09", 37747], ["2026-07-10", 42269], ["2026-07-11", 58518], ["2026-07-12", 27667], ["2026-07-13", 52979], ["2026-07-14", 49789], ["2026-07-15", 25343], ["2026-07-16", 29279], ["2026-07-17", 41628], ["2026-07-18", 46129], ["2026-07-19", 34962], ["2026-07-20", 43742], ["2026-07-21", 40948], ["2026-07-22", 45552], ["2026-07-23", 26826], ["2026-07-24", 49751], ["2026-07-25", 30147], ["2026-07-26", 34592], ["2026-07-27", 61314], ["2026-07-28", 38322], ["2026-07-29", 37432], ["2026-07-30", 30821], ["2026-07-31", 38062]]
Full documentation
correct
Model response
{"kind":"sql","sql":"SELECT spend_date AS date, SUM(net_spend_minor) AS net_card_spend_minor\nFROM card_spend_daily\nWHERE currency = 'CAD' AND spend_date >= '2026-07-01' AND spend_date < '2026-08-01'\nGROUP BY spend_date\nORDER BY spend_date ASC"}Executed rows
[["2026-07-01", 66420], ["2026-07-02", 48706], ["2026-07-03", 29351], ["2026-07-04", 43817], ["2026-07-05", 25257], ["2026-07-06", 47767], ["2026-07-07", 54913], ["2026-07-08", 37942], ["2026-07-09", 37747], ["2026-07-10", 42269], ["2026-07-11", 58518], ["2026-07-12", 27667], ["2026-07-13", 52979], ["2026-07-14", 49789], ["2026-07-15", 25343], ["2026-07-16", 29279], ["2026-07-17", 41628], ["2026-07-18", 46129], ["2026-07-19", 34962], ["2026-07-20", 43742], ["2026-07-21", 40948], ["2026-07-22", 45552], ["2026-07-23", 26826], ["2026-07-24", 49751], ["2026-07-25", 30147], ["2026-07-26", 34592], ["2026-07-27", 61314], ["2026-07-28", 38322], ["2026-07-29", 37432], ["2026-07-30", 30821], ["2026-07-31", 38062]]
Current models, correct runs
| Model | Bare schema | Schema plus allowed values | Full documentation |
|---|---|---|---|
| Claude Sonnet 5.5 | 3 of 3 | 3 of 3 | 3 of 3 |
| Claude Opus 5.5 | 3 of 3 | 3 of 3 | 3 of 3 |
Expected result
[["2026-07-01", 66420], ["2026-07-02", 48706], ["2026-07-03", 29351], ["2026-07-04", 43817], ["2026-07-05", 25257], ["2026-07-06", 47767], ["2026-07-07", 54913], ["2026-07-08", 37942], ["2026-07-09", 37747], ["2026-07-10", 42269], ["2026-07-11", 58518], ["2026-07-12", 27667], ["2026-07-13", 52979], ["2026-07-14", 49789], ["2026-07-15", 25343], ["2026-07-16", 29279], ["2026-07-17", 41628], ["2026-07-18", 46129], ["2026-07-19", 34962], ["2026-07-20", 43742], ["2026-07-21", 40948], ["2026-07-22", 45552], ["2026-07-23", 26826], ["2026-07-24", 49751], ["2026-07-25", 30147], ["2026-07-26", 34592], ["2026-07-27", 61314], ["2026-07-28", 38322], ["2026-07-29", 37432], ["2026-07-30", 30821], ["2026-07-31", 38062]]
Gold SQL
SELECT CAST(spend_date AS VARCHAR),SUM(net_spend_minor) FROM card_spend_daily WHERE spend_date >= DATE '2026-07-01' AND spend_date < DATE '2026-08-01' AND currency='CAD' GROUP BY spend_date ORDER BY spend_date
Which three CAD accounts had the highest July 2026 net card spend? Include all accounts as candidates. Return account_id and net minor units, descending by spend and then ascending by account_id to break ties.Bare: correct · Allowed values: correct · Documentation: correct
Rubric: analytical SQL. Expected columns: account_id, net_minor. Row order required.
Bare schema
correct
Model response
{"kind":"sql","sql":"SELECT account_id, SUM(net_spend_minor) AS net_spend_minor FROM card_spend_daily WHERE currency = 'CAD' AND spend_date >= DATE '2026-07-01' AND spend_date <= DATE '2026-07-31' GROUP BY account_id ORDER BY net_spend_minor DESC, account_id ASC LIMIT 3"}Executed rows
[["acct_007", 130636], ["acct_001", 129813], ["acct_011", 126577]]
Schema plus allowed values
correct
Model response
{"kind":"sql","sql":"SELECT csd.account_id, SUM(csd.net_spend_minor) AS net_minor_units\nFROM card_spend_daily csd\nJOIN accounts a ON csd.account_id = a.account_id\nWHERE csd.currency = 'CAD' AND a.currency = 'CAD' AND csd.spend_date >= DATE '2026-07-01' AND csd.spend_date < DATE '2026-08-01'\nGROUP BY csd.account_id\nORDER BY net_minor_units DESC, csd.account_id ASC\nLIMIT 3"}Executed rows
[["acct_007", 130636], ["acct_001", 129813], ["acct_011", 126577]]
Full documentation
correct
Model response
{"kind":"sql","sql":"SELECT account_id, SUM(net_spend_minor) AS net_spend_minor\nFROM card_spend_daily\nWHERE currency = 'CAD' AND spend_date >= DATE '2026-07-01' AND spend_date < DATE '2026-08-01'\nGROUP BY account_id\nORDER BY net_spend_minor DESC, account_id ASC\nLIMIT 3"}Executed rows
[["acct_007", 130636], ["acct_001", 129813], ["acct_011", 126577]]
Current models, correct runs
| Model | Bare schema | Schema plus allowed values | Full documentation |
|---|---|---|---|
| Claude Sonnet 5.5 | 3 of 3 | 3 of 3 | 3 of 3 |
| Claude Opus 5.5 | 3 of 3 | 3 of 3 | 3 of 3 |
Expected result
[["acct_007", 130636], ["acct_001", 129813], ["acct_011", 126577]]
Gold SQL
SELECT a.account_id,COALESCE(SUM(s.net_spend_minor),0) AS net FROM accounts a LEFT JOIN card_spend_daily s ON a.account_id=s.account_id AND s.spend_date >= DATE '2026-07-01' AND spend_date < DATE '2026-08-01' WHERE a.currency='CAD' GROUP BY a.account_id ORDER BY net DESC,a.account_id LIMIT 3
Which three category labels had the highest July 2026 net card spend in CAD? Include the uncategorized bucket. Return category label and net minor units, descending by spend and then ascending by label to break ties.Bare: correct · Allowed values: correct · Documentation: correct
Rubric: analytical SQL. Expected columns: category, net_minor. Row order required.
Bare schema
correct
Model response
{"kind":"sql","sql":"SELECT COALESCE(c.category_name, 'Uncategorized') AS category_label, SUM(cs.net_spend_minor) AS net_minor_units\nFROM card_spend_daily cs\nLEFT JOIN categories c ON cs.category_id = c.category_id\nWHERE cs.currency = 'CAD' AND EXTRACT(YEAR FROM cs.spend_date) = 2026 AND EXTRACT(MONTH FROM cs.spend_date) = 7\nGROUP BY category_label\nORDER BY net_minor_units DESC, category_label ASC\nLIMIT 3"}Executed rows
[["Meals", 293557], ["Uncategorized", 291177], ["Travel", 249615]]
Schema plus allowed values
correct
Model response
{"kind":"sql","sql":"SELECT COALESCE(c.category_name, 'Uncategorized') AS category_label, SUM(cs.net_spend_minor) AS net_minor_units\nFROM card_spend_daily cs\nLEFT JOIN categories c ON cs.category_id = c.category_id\nWHERE cs.currency = 'CAD' AND EXTRACT(YEAR FROM cs.spend_date) = 2026 AND EXTRACT(MONTH FROM cs.spend_date) = 7\nGROUP BY category_label\nORDER BY net_minor_units DESC, category_label ASC\nLIMIT 3"}Executed rows
[["Meals", 293557], ["Uncategorized", 291177], ["Travel", 249615]]
Full documentation
correct
Model response
{"kind":"sql","sql":"SELECT COALESCE(c.category_name, 'Uncategorized') AS category_label, SUM(cs.net_spend_minor) AS net_minor_units\nFROM card_spend_daily cs\nLEFT JOIN categories c ON cs.category_id = c.category_id\nWHERE cs.spend_date >= DATE '2026-07-01' AND cs.spend_date < DATE '2026-08-01' AND cs.currency = 'CAD'\nGROUP BY category_label\nORDER BY net_minor_units DESC, category_label ASC\nLIMIT 3"}Executed rows
[["Meals", 293557], ["Uncategorized", 291177], ["Travel", 249615]]
Current models, correct runs
| Model | Bare schema | Schema plus allowed values | Full documentation |
|---|---|---|---|
| Claude Sonnet 5.5 | 3 of 3 | 3 of 3 | 3 of 3 |
| Claude Opus 5.5 | 3 of 3 | 3 of 3 | 3 of 3 |
Expected result
[["Meals", 293557], ["Uncategorized", 291177], ["Travel", 249615]]
Gold SQL
SELECT COALESCE(c.category_name,'Uncategorized') AS label,SUM(s.net_spend_minor) AS net FROM card_spend_daily s LEFT JOIN categories c ON s.category_id=c.category_id WHERE spend_date >= DATE '2026-07-01' AND spend_date < DATE '2026-08-01' AND s.currency='CAD' GROUP BY label ORDER BY net DESC,label LIMIT 3
At the snapshot, how many active cards does every CAD account have? Include accounts with none. Return account_id and active-card count.Bare: correct · Allowed values: correct · Documentation: correct
Rubric: analytical SQL. Expected columns: account_id, active_cards. Row order not scored.
Bare schema
correct
Model response
{"kind":"sql","sql":"SELECT a.account_id, COUNT(c.card_id) AS active_card_count FROM accounts a LEFT JOIN cards c ON a.account_id = c.account_id AND c.card_status = 'active' WHERE a.currency = 'CAD' GROUP BY a.account_id"}Executed rows
[["acct_001", 2], ["acct_002", 2], ["acct_004", 2], ["acct_005", 1], ["acct_007", 2], ["acct_008", 2], ["acct_010", 1], ["acct_011", 2], ["acct_013", 2], ["acct_014", 2], ["acct_016", 2], ["acct_017", 2], ["acct_019", 0]]
Schema plus allowed values
correct
Model response
{"kind":"sql","sql":"SELECT a.account_id, COUNT(c.card_id) AS active_card_count\nFROM accounts a\nLEFT JOIN cards c ON a.account_id = c.account_id AND c.card_status = 'active'\nWHERE a.currency = 'CAD'\nGROUP BY a.account_id"}Executed rows
[["acct_001", 2], ["acct_002", 2], ["acct_004", 2], ["acct_005", 1], ["acct_007", 2], ["acct_008", 2], ["acct_010", 1], ["acct_011", 2], ["acct_013", 2], ["acct_014", 2], ["acct_016", 2], ["acct_017", 2], ["acct_019", 0]]
Full documentation
correct
Model response
{"kind":"sql","sql":"SELECT a.account_id, COUNT(c.card_id) AS active_card_count\nFROM accounts a\nLEFT JOIN cards c ON a.account_id = c.account_id AND c.card_status = 'active'\nWHERE a.currency = 'CAD'\nGROUP BY a.account_id"}Executed rows
[["acct_001", 2], ["acct_002", 2], ["acct_004", 2], ["acct_005", 1], ["acct_007", 2], ["acct_008", 2], ["acct_010", 1], ["acct_011", 2], ["acct_013", 2], ["acct_014", 2], ["acct_016", 2], ["acct_017", 2], ["acct_019", 0]]
Current models, correct runs
| Model | Bare schema | Schema plus allowed values | Full documentation |
|---|---|---|---|
| Claude Sonnet 5.5 | 3 of 3 | 3 of 3 | 3 of 3 |
| Claude Opus 5.5 | 3 of 3 | 3 of 3 | 3 of 3 |
Expected result
[["acct_001", 2], ["acct_002", 2], ["acct_004", 2], ["acct_005", 1], ["acct_007", 2], ["acct_008", 2], ["acct_010", 1], ["acct_011", 2], ["acct_013", 2], ["acct_014", 2], ["acct_016", 2], ["acct_017", 2], ["acct_019", 0]]
Gold SQL
SELECT a.account_id,COUNT(c.card_id) FROM accounts a LEFT JOIN cards c ON a.account_id=c.account_id AND c.card_status='active' WHERE a.currency='CAD' GROUP BY a.account_id
At the snapshot, how many active cards are there in each account currency? Return currency and active-card count, retaining currencies with no active cards.Bare: correct · Allowed values: query denied · Documentation: correct
Rubric: analytical SQL. Expected columns: currency, active_cards. Row order not scored.
Bare schema
correct
Model response
{"kind":"sql","sql":"SELECT currency, COUNT(*) FILTER (WHERE card_status = 'active') AS active_card_count FROM cards RIGHT JOIN accounts USING(account_id) GROUP BY currency ORDER BY currency"}Executed rows
[["CAD", 22], ["USD", 5]]
Schema plus allowed values
query denied
Model response
{"kind":"sql","sql":"SELECT currency, COUNT(*) AS active_card_count FROM cards JOIN accounts USING(account_id) WHERE card_status = 'active' GROUP BY currency UNION ALL SELECT currency, 0 FROM accounts WHERE currency NOT IN (SELECT currency FROM cards JOIN accounts USING(account_id) WHERE card_status = 'active') GROUP BY currency ORDER BY currency"}Executed rows
null
Full documentation
correct
Model response
{"kind":"sql","sql":"SELECT a.currency, COUNT(c.card_id) AS active_card_count\nFROM accounts a\nLEFT JOIN cards c ON a.account_id = c.account_id AND c.card_status = 'active'\nGROUP BY a.currency\nORDER BY a.currency"}Executed rows
[["CAD", 22], ["USD", 5]]
Current models, correct runs
| Model | Bare schema | Schema plus allowed values | Full documentation |
|---|---|---|---|
| Claude Sonnet 5.5 | 3 of 3 | 3 of 3 | 3 of 3 |
| Claude Opus 5.5 | 3 of 3 | 3 of 3 | 3 of 3 |
Expected result
[["CAD", 22], ["USD", 5]]
Gold SQL
SELECT a.currency,COUNT(c.card_id) FROM accounts a LEFT JOIN cards c ON a.account_id=c.account_id AND c.card_status='active' GROUP BY a.currency
For each CAD purchase that received a refund in July 2026, show original transaction_id, original purchase amount and the total refunded during July, all amounts in minor units. The original purchase may be in another reporting period.Bare: correct · Allowed values: correct · Documentation: correct
Rubric: analytical SQL. Expected columns: transaction_id, original_minor, refunded_minor. Row order not scored.
Bare schema
correct
Model response
{"kind":"sql","sql":"WITH RefundsInJuly AS (\n SELECT\n related_transaction_id AS original_transaction_id,\n SUM(amount_minor) AS total_refunded_july\n FROM transactions\n WHERE direction = 'credit'\n AND currency = 'CAD'\n AND status = 'posted'\n AND event_kind = 'refund'\n AND EXTRACT(YEAR FROM occurred_at) = 2026\n AND EXTRACT(MONTH FROM occurred_at) = 7\n GROUP BY related_transaction_id\n),\nOriginalPurchases AS (\n SELECT\n transaction_id,\n amount_minor AS original_purchase_amount\n FROM transactions\n WHERE direction = 'debit'\n AND currency = 'CAD'\n AND status = 'posted'\n AND event_kind = 'purchase'\n)\nSELECT\n o.transaction_id AS original_transaction_id,\n o.original_purchase_amount,\n r.total_refunded_july\nFROM OriginalPurchases o\nJOIN RefundsInJuly r ON o.transaction_id = r.original_transaction_id"}Executed rows
[["txn_00007", 1520, 506], ["txn_00015", 7754, 2584], ["txn_00030", 8191, 2730], ["txn_00041", 9577, 3192], ["txn_00049", 1443, 481], ["txn_00057", 4566, 1522], ["txn_00065", 546, 182], ["txn_00118", 5858, 1952], ["txn_00126", 3656, 1218], ["txn_00134", 6827, 2275], ["txn_00145", 5990, 1996], ["txn_00153", 3000, 1000], ["txn_00212", 7369, 2456], ["txn_00220", 6360, 2120], ["txn_00228", 9820, 3273], ["txn_00236", 5333, 1777], ["txn_00247", 6544, 2181], ["txn_00262", 5017, 1672], ["txn_00270", 6727, 2242], ["txn_00316", 960, 320], ["txn_00324", 7040, 2346], ["txn_00332", 3863, 1287], ["txn_00340", 3740, 1246], ["txn_00351", 5838, 1946], ["txn_00359", 1907, 635], ["txn_00367", 2869, 956], ["txn_00418", 5596, 1865], ["txn_00426", 5476, 1825], ["txn_00434", 5894, 1964], ["txn_00442", 4394, 1464], ["txn_00453", 8460, 2820], ["txn_00461", 7231, 2410], ["txn_00469", 1055, 351], ["txn_00477", 2564, 854], ["txn_00522", 3059, 1019], ["txn_00530", 3720, 1240], ["txn_00538", 4208, 1402], ["boundary_june_occurrence", 12345, 3345]]
Schema plus allowed values
correct
Model response
{"kind":"sql","sql":"WITH RefundsInJuly AS (\n SELECT\n related_transaction_id AS original_transaction_id,\n SUM(amount_minor) AS total_refunded_july\n FROM transactions\n WHERE event_kind = 'refund'\n AND currency = 'CAD'\n AND status = 'posted'\n AND EXTRACT(YEAR FROM occurred_at) = 2026\n AND EXTRACT(MONTH FROM occurred_at) = 7\n GROUP BY related_transaction_id\n),\nOriginalPurchases AS (\n SELECT\n transaction_id,\n amount_minor AS original_purchase_amount\n FROM transactions\n WHERE event_kind = 'purchase'\n AND currency = 'CAD'\n AND status = 'posted'\n)\nSELECT\n o.transaction_id AS original_transaction_id,\n o.original_purchase_amount,\n r.total_refunded_july\nFROM OriginalPurchases o\nJOIN RefundsInJuly r ON o.transaction_id = r.original_transaction_id;"}Executed rows
[["txn_00007", 1520, 506], ["txn_00015", 7754, 2584], ["txn_00030", 8191, 2730], ["txn_00041", 9577, 3192], ["txn_00049", 1443, 481], ["txn_00057", 4566, 1522], ["txn_00065", 546, 182], ["txn_00118", 5858, 1952], ["txn_00126", 3656, 1218], ["txn_00134", 6827, 2275], ["txn_00145", 5990, 1996], ["txn_00153", 3000, 1000], ["txn_00212", 7369, 2456], ["txn_00220", 6360, 2120], ["txn_00228", 9820, 3273], ["txn_00236", 5333, 1777], ["txn_00247", 6544, 2181], ["txn_00262", 5017, 1672], ["txn_00270", 6727, 2242], ["txn_00316", 960, 320], ["txn_00324", 7040, 2346], ["txn_00332", 3863, 1287], ["txn_00340", 3740, 1246], ["txn_00351", 5838, 1946], ["txn_00359", 1907, 635], ["txn_00367", 2869, 956], ["txn_00418", 5596, 1865], ["txn_00426", 5476, 1825], ["txn_00434", 5894, 1964], ["txn_00442", 4394, 1464], ["txn_00453", 8460, 2820], ["txn_00461", 7231, 2410], ["txn_00469", 1055, 351], ["txn_00477", 2564, 854], ["txn_00522", 3059, 1019], ["txn_00530", 3720, 1240], ["txn_00538", 4208, 1402], ["boundary_june_occurrence", 12345, 3345]]
Full documentation
correct
Model response
{"kind":"sql","sql":"SELECT p.transaction_id AS original_transaction_id, p.amount_minor AS original_purchase_amount, SUM(r.amount_minor) AS total_refunded_in_july\nFROM transactions p\nJOIN transactions r ON r.related_transaction_id = p.transaction_id\nWHERE p.event_kind = 'purchase'\n AND p.currency = 'CAD'\n AND r.event_kind = 'refund'\n AND r.status = 'posted'\n AND r.posted_at >= '2026-07-01' AND r.posted_at < '2026-08-01'\nGROUP BY p.transaction_id, p.amount_minor"}Executed rows
[["txn_00007", 1520, 506], ["txn_00015", 7754, 2584], ["txn_00030", 8191, 2730], ["txn_00041", 9577, 3192], ["txn_00049", 1443, 481], ["txn_00057", 4566, 1522], ["txn_00065", 546, 182], ["txn_00118", 5858, 1952], ["txn_00126", 3656, 1218], ["txn_00134", 6827, 2275], ["txn_00145", 5990, 1996], ["txn_00153", 3000, 1000], ["txn_00212", 7369, 2456], ["txn_00220", 6360, 2120], ["txn_00228", 9820, 3273], ["txn_00236", 5333, 1777], ["txn_00247", 6544, 2181], ["txn_00262", 5017, 1672], ["txn_00270", 6727, 2242], ["txn_00316", 960, 320], ["txn_00324", 7040, 2346], ["txn_00332", 3863, 1287], ["txn_00340", 3740, 1246], ["txn_00351", 5838, 1946], ["txn_00359", 1907, 635], ["txn_00367", 2869, 956], ["txn_00418", 5596, 1865], ["txn_00426", 5476, 1825], ["txn_00434", 5894, 1964], ["txn_00442", 4394, 1464], ["txn_00453", 8460, 2820], ["txn_00461", 7231, 2410], ["txn_00469", 1055, 351], ["txn_00477", 2564, 854], ["txn_00522", 3059, 1019], ["txn_00530", 3720, 1240], ["txn_00538", 4208, 1402], ["boundary_june_occurrence", 12345, 3345]]
Current models, correct runs
| Model | Bare schema | Schema plus allowed values | Full documentation |
|---|---|---|---|
| Claude Sonnet 5.5 | 3 of 3 | 3 of 3 | 3 of 3 |
| Claude Opus 5.5 | 3 of 3 | 3 of 3 | 3 of 3 |
Expected result
[["txn_00007", 1520, 506], ["txn_00015", 7754, 2584], ["txn_00030", 8191, 2730], ["txn_00041", 9577, 3192], ["txn_00049", 1443, 481], ["txn_00057", 4566, 1522], ["txn_00065", 546, 182], ["txn_00118", 5858, 1952], ["txn_00126", 3656, 1218], ["txn_00134", 6827, 2275], ["txn_00145", 5990, 1996], ["txn_00153", 3000, 1000], ["txn_00212", 7369, 2456], ["txn_00220", 6360, 2120], ["txn_00228", 9820, 3273], ["txn_00236", 5333, 1777], ["txn_00247", 6544, 2181], ["txn_00262", 5017, 1672], ["txn_00270", 6727, 2242], ["txn_00316", 960, 320], ["txn_00324", 7040, 2346], ["txn_00332", 3863, 1287], ["txn_00340", 3740, 1246], ["txn_00351", 5838, 1946], ["txn_00359", 1907, 635], ["txn_00367", 2869, 956], ["txn_00418", 5596, 1865], ["txn_00426", 5476, 1825], ["txn_00434", 5894, 1964], ["txn_00442", 4394, 1464], ["txn_00453", 8460, 2820], ["txn_00461", 7231, 2410], ["txn_00469", 1055, 351], ["txn_00477", 2564, 854], ["txn_00522", 3059, 1019], ["txn_00530", 3720, 1240], ["txn_00538", 4208, 1402], ["boundary_june_occurrence", 12345, 3345]]
Gold SQL
SELECT p.transaction_id,p.amount_minor,SUM(r.amount_minor) FROM transactions r JOIN transactions p ON r.related_transaction_id=p.transaction_id WHERE r.event_kind='refund' AND r.status='posted' AND r.currency='CAD' AND r.posted_at >= TIMESTAMP '2026-07-01' AND r.posted_at < TIMESTAMP '2026-08-01' GROUP BY p.transaction_id,p.amount_minor
How many distinct CAD purchases received at least one refund during July 2026? Return one count, including purchases from earlier periods.Bare: wrong answer · Allowed values: correct · Documentation: correct
Rubric: analytical SQL. Expected columns: purchase_count. Row order not scored.
Bare schema
wrong answer
Model response
{"kind":"sql","sql":"SELECT COUNT(DISTINCT t1.transaction_id) AS count_distinct_cad_purchases_with_refund FROM transactions t1 JOIN transactions t2 ON t1.transaction_id = t2.related_transaction_id WHERE t1.direction = 'credit' AND t1.currency = 'CAD' AND t1.status = 'posted' AND t2.direction = 'debit' AND t2.status = 'posted' AND t2.occurred_at >= '2026-07-01' AND t2.occurred_at < '2026-08-01'"}Executed rows
[[0]]
Schema plus allowed values
correct
Model response
{"kind":"sql","sql":"SELECT COUNT(DISTINCT t1.transaction_id) AS count_distinct_purchases_with_refund\nFROM transactions t1\nJOIN transactions t2 ON t1.transaction_id = t2.related_transaction_id\nWHERE t1.currency = 'CAD'\n AND t1.event_kind = 'purchase'\n AND t1.status = 'posted'\n AND t2.event_kind = 'refund'\n AND t2.status = 'posted'\n AND EXTRACT(YEAR FROM t2.occurred_at) = 2026\n AND EXTRACT(MONTH FROM t2.occurred_at) = 7"}Executed rows
[[38]]
Full documentation
correct
Model response
{"kind":"sql","sql":"SELECT COUNT(DISTINCT t1.transaction_id) AS count_refunded_purchases\nFROM transactions t1\nJOIN transactions t2 ON t2.related_transaction_id = t1.transaction_id\nWHERE t1.currency = 'CAD'\n AND t1.event_kind = 'purchase'\n AND t1.status = 'posted'\n AND t2.event_kind = 'refund'\n AND t2.status = 'posted'\n AND t2.posted_at >= '2026-07-01' AND t2.posted_at < '2026-08-01'"}Executed rows
[[38]]
Current models, correct runs
| Model | Bare schema | Schema plus allowed values | Full documentation |
|---|---|---|---|
| Claude Sonnet 5.5 | 3 of 3 | 3 of 3 | 3 of 3 |
| Claude Opus 5.5 | 2 of 3 | 3 of 3 | 3 of 3 |
Expected result
[[38]]
Gold SQL
SELECT COUNT(DISTINCT related_transaction_id) FROM transactions WHERE event_kind='refund' AND status='posted' AND currency='CAD' AND posted_at >= TIMESTAMP '2026-07-01' AND posted_at < TIMESTAMP '2026-08-01'
What was the deposit amount in CAD during July 2026? Return one amount in minor units.Bare: wrong answer · Allowed values: correct · Documentation: correct
Rubric: analytical SQL. Expected columns: amount_minor. Row order not scored.
Bare schema
wrong answer
Model response
{"kind":"sql","sql":"SELECT COALESCE(SUM(amount_minor), 0) AS deposit_amount_minor FROM transactions WHERE direction = 'inbound' AND currency = 'CAD' AND occurred_at >= '2026-07-01' AND occurred_at < '2026-08-01' AND status = 'posted'"}Executed rows
[[0]]
Schema plus allowed values
correct
Model response
{"kind":"sql","sql":"SELECT COALESCE(SUM(amount_minor), 0) AS deposit_amount_minor FROM transactions WHERE event_kind = 'deposit' AND currency = 'CAD' AND occurred_at >= '2026-07-01' AND occurred_at < '2026-08-01' AND status = 'posted'"}Executed rows
[[769596]]
Full documentation
correct
Model response
{"kind":"sql","sql":"SELECT COALESCE(SUM(amount_minor), 0) AS deposit_amount_minor FROM transactions WHERE currency = 'CAD' AND event_kind = 'deposit' AND status = 'posted' AND posted_at >= '2026-07-01' AND posted_at < '2026-08-01'"}Executed rows
[[769596]]
Current models, correct runs
| Model | Bare schema | Schema plus allowed values | Full documentation |
|---|---|---|---|
| Claude Sonnet 5.5 | 3 of 3 | 3 of 3 | 3 of 3 |
| Claude Opus 5.5 | 1 of 3 | 3 of 3 | 3 of 3 |
Expected result
[[769596]]
Gold SQL
SELECT COALESCE(SUM(amount_minor),0) FROM transactions WHERE event_kind='deposit' AND status='posted' AND currency='CAD' AND posted_at >= TIMESTAMP '2026-07-01' AND posted_at < TIMESTAMP '2026-08-01'
What was the deposit amount in USD during July 2026? Return one amount in minor units.Bare: wrong answer · Allowed values: correct · Documentation: correct
Rubric: analytical SQL. Expected columns: amount_minor. Row order not scored.
Bare schema
wrong answer
Model response
{"kind":"sql","sql":"SELECT COALESCE(SUM(amount_minor), 0) AS deposit_amount_minor FROM transactions WHERE direction = 'inbound' AND status = 'posted' AND currency = 'USD' AND occurred_at >= '2026-07-01' AND occurred_at < '2026-08-01'"}Executed rows
[[0]]
Schema plus allowed values
correct
Model response
{"kind":"sql","sql":"SELECT COALESCE(SUM(amount_minor), 0) AS deposit_amount_usd_july_2026 FROM transactions WHERE event_kind = 'deposit' AND currency = 'USD' AND occurred_at >= '2026-07-01' AND occurred_at < '2026-08-01' AND status = 'posted'"}Executed rows
[[320665]]
Full documentation
correct
Model response
{"kind":"sql","sql":"SELECT COALESCE(SUM(amount_minor), 0) AS deposit_amount_usd FROM transactions WHERE currency = 'USD' AND event_kind = 'deposit' AND status = 'posted' AND posted_at >= '2026-07-01' AND posted_at < '2026-08-01'"}Executed rows
[[320665]]
Current models, correct runs
| Model | Bare schema | Schema plus allowed values | Full documentation |
|---|---|---|---|
| Claude Sonnet 5.5 | 3 of 3 | 3 of 3 | 3 of 3 |
| Claude Opus 5.5 | 1 of 3 | 3 of 3 | 3 of 3 |
Expected result
[[320665]]
Gold SQL
SELECT COALESCE(SUM(amount_minor),0) FROM transactions WHERE event_kind='deposit' AND status='posted' AND currency='USD' AND posted_at >= TIMESTAMP '2026-07-01' AND posted_at < TIMESTAMP '2026-08-01'
What was the withdrawal amount in CAD during July 2026? Return one amount in minor units.Bare: wrong answer · Allowed values: correct · Documentation: correct
Rubric: analytical SQL. Expected columns: amount_minor. Row order not scored.
Bare schema
wrong answer
Model response
{"kind":"sql","sql":"SELECT COALESCE(SUM(amount_minor), 0) AS withdrawal_amount_minor FROM transactions WHERE currency = 'CAD' AND direction = 'outbound' AND occurred_at >= '2026-07-01' AND occurred_at < '2026-08-01'"}Executed rows
[[0]]
Schema plus allowed values
correct
Model response
{"kind":"sql","sql":"SELECT COALESCE(SUM(amount_minor), 0) AS withdrawal_amount_minor FROM transactions WHERE event_kind = 'withdrawal' AND currency = 'CAD' AND occurred_at >= '2026-07-01' AND occurred_at < '2026-08-01' AND status = 'posted'"}Executed rows
[[12084]]
Full documentation
correct
Model response
{"kind":"sql","sql":"SELECT COALESCE(SUM(amount_minor), 0) AS withdrawal_amount_minor FROM transactions WHERE event_kind = 'withdrawal' AND currency = 'CAD' AND status = 'posted' AND posted_at >= '2026-07-01' AND posted_at < '2026-08-01'"}Executed rows
[[12084]]
Current models, correct runs
| Model | Bare schema | Schema plus allowed values | Full documentation |
|---|---|---|---|
| Claude Sonnet 5.5 | 3 of 3 | 3 of 3 | 3 of 3 |
| Claude Opus 5.5 | 1 of 3 | 3 of 3 | 3 of 3 |
Expected result
[[12084]]
Gold SQL
SELECT COALESCE(SUM(amount_minor),0) FROM transactions WHERE event_kind='withdrawal' AND status='posted' AND currency='CAD' AND posted_at >= TIMESTAMP '2026-07-01' AND posted_at < TIMESTAMP '2026-08-01'
What was net external cash flow in CAD during July 2026? Return one signed amount in minor units.Bare: wrong answer · Allowed values: wrong answer · Documentation: SQL error
Rubric: analytical SQL. Expected columns: net_minor. Row order not scored.
Bare schema
wrong answer
Model response
{"kind":"sql","sql":"SELECT COALESCE(SUM(CASE WHEN direction = 'inbound' THEN amount_minor ELSE -amount_minor END), 0) AS net_external_cash_flow_minor FROM transactions WHERE currency = 'CAD' AND occurred_at >= '2026-07-01' AND occurred_at < '2026-08-01' AND event_kind = 'external' AND status = 'posted'"}Executed rows
[[0]]
Schema plus allowed values
wrong answer
Model response
{"kind":"sql","sql":"SELECT COALESCE(SUM(CASE WHEN direction = 'credit' THEN amount_minor ELSE -amount_minor END), 0) AS net_external_cash_flow_minor FROM transactions WHERE currency = 'CAD' AND status = 'posted' AND occurred_at >= '2026-07-01' AND occurred_at < '2026-08-01' AND event_kind IN ('deposit', 'withdrawal', 'transfer')"}Executed rows
[[757512]]
Full documentation
SQL error
Model response
{"kind":"sql","sql":"SELECT COALESCE(SUM(CASE WHEN direction = 'credit' THEN amount_minor ELSE -amount_minor END), 0) AS net_external_cash_flow_cad_minor\nFROM transactions\nJOIN accounts USING (account_id)\nWHERE currency = 'CAD'\n AND status = 'posted'\n AND event_kind != 'transfer'\n AND posted_at >= '2026-07-01 00:00:00'\n AND posted_at < '2026-08-01 00:00:00'"}Executed rows
null
Current models, correct runs
| Model | Bare schema | Schema plus allowed values | Full documentation |
|---|---|---|---|
| Claude Sonnet 5.5 | 0 of 3 | 0 of 3 | 3 of 3 |
| Claude Opus 5.5 | 3 of 3 | 3 of 3 | 3 of 3 |
Expected result
[[-520480]]
Gold SQL
SELECT COALESCE(SUM(CASE WHEN direction='credit' THEN amount_minor ELSE -amount_minor END),0) FROM transactions WHERE event_kind <> 'transfer' AND status='posted' AND currency='CAD' AND posted_at >= TIMESTAMP '2026-07-01' AND posted_at < TIMESTAMP '2026-08-01'
What was net external cash flow in USD during July 2026? Return one signed amount in minor units.Bare: wrong answer · Allowed values: wrong answer · Documentation: correct
Rubric: analytical SQL. Expected columns: net_minor. Row order not scored.
Bare schema
wrong answer
Model response
{"kind":"sql","sql":"SELECT COALESCE(SUM(CASE WHEN direction = 'inbound' THEN amount_minor ELSE -amount_minor END), 0) AS net_external_cash_flow_usd_minor FROM transactions WHERE currency = 'USD' AND occurred_at >= '2026-07-01' AND occurred_at < '2026-08-01' AND event_kind = 'external' AND status = 'posted'"}Executed rows
[[0]]
Schema plus allowed values
wrong answer
Model response
{"kind":"sql","sql":"SELECT COALESCE(SUM(CASE WHEN direction = 'credit' THEN amount_minor ELSE -amount_minor END), 0) AS net_external_cash_flow_usd_july_2026 FROM transactions WHERE currency = 'USD' AND status = 'posted' AND occurred_at >= '2026-07-01' AND occurred_at < '2026-08-01' AND event_kind IN ('deposit', 'withdrawal')"}Executed rows
[[315630]]
Full documentation
correct
Model response
{"kind":"sql","sql":"SELECT SUM(CASE WHEN direction = 'credit' THEN amount_minor ELSE -amount_minor END) AS net_external_cash_flow_usd\nFROM transactions\nWHERE currency = 'USD'\n AND status = 'posted'\n AND event_kind != 'transfer'\n AND posted_at >= '2026-07-01 00:00:00'\n AND posted_at < '2026-08-01 00:00:00'"}Executed rows
[[-238702]]
Current models, correct runs
| Model | Bare schema | Schema plus allowed values | Full documentation |
|---|---|---|---|
| Claude Sonnet 5.5 | 0 of 3 | 0 of 3 | 3 of 3 |
| Claude Opus 5.5 | 2 of 3 | 3 of 3 | 3 of 3 |
Expected result
[[-238702]]
Gold SQL
SELECT COALESCE(SUM(CASE WHEN direction='credit' THEN amount_minor ELSE -amount_minor END),0) FROM transactions WHERE event_kind <> 'transfer' AND status='posted' AND currency='USD' AND posted_at >= TIMESTAMP '2026-07-01' AND posted_at < TIMESTAMP '2026-08-01'
What was internal transfer volume in CAD during July 2026? Count each transfer once. Return one amount in minor units.Bare: correct · Allowed values: correct · Documentation: SQL error
Rubric: analytical SQL. Expected columns: amount_minor. Row order not scored.
Bare schema
correct
Model response
{"kind":"sql","sql":"SELECT SUM(ABS(amount_minor)) AS internal_transfer_volume_minor FROM (SELECT DISTINCT transfer_group_id, amount_minor FROM transactions WHERE currency = 'CAD' AND event_kind = 'transfer' AND status = 'posted' AND DATE_TRUNC('month', occurred_at) = DATE '2026-07-01' AND transfer_group_id IS NOT NULL)"}Executed rows
[[13910]]
Schema plus allowed values
correct
Model response
{"kind":"sql","sql":"SELECT COALESCE(SUM(ABS(amount_minor)), 0) AS internal_transfer_volume_cad_july_2026 FROM (SELECT DISTINCT transfer_group_id, amount_minor FROM transactions WHERE currency = 'CAD' AND event_kind = 'transfer' AND status = 'posted' AND EXTRACT(YEAR FROM occurred_at) = 2026 AND EXTRACT(MONTH FROM occurred_at) = 7 AND transfer_group_id IS NOT NULL)"}Executed rows
[[13910]]
Full documentation
SQL error
Model response
{"kind":"sql","sql":"SELECT SUM(t.amount_minor) AS internal_transfer_volume_cad_july_2026\nFROM (\n SELECT DISTINCT tg.transfer_group_id, t.amount_minor\n FROM transactions t\n JOIN transactions t2 ON t.transfer_group_id = t2.transfer_group_id\n WHERE t.currency = 'CAD'\n AND t.event_kind = 'transfer'\n AND t.status = 'posted'\n AND t.posted_at >= '2026-07-01' AND t.posted_at < '2026-08-01'\n AND t.direction = 'debit'\n) tg"}Executed rows
null
Current models, correct runs
| Model | Bare schema | Schema plus allowed values | Full documentation |
|---|---|---|---|
| Claude Sonnet 5.5 | 0 of 3 | 3 of 3 | 3 of 3 |
| Claude Opus 5.5 | 3 of 3 | 3 of 3 | 3 of 3 |
Expected result
[[13910]]
Gold SQL
SELECT COALESCE(SUM(amount_minor),0) FROM transactions WHERE event_kind='transfer' AND status='posted' AND direction='debit' AND currency='CAD' AND posted_at >= TIMESTAMP '2026-07-01' AND posted_at < TIMESTAMP '2026-08-01'
How many internal transfers completed during July 2026, by currency? Count each transfer once. Return currency and transfer count.Bare: wrong answer · Allowed values: correct · Documentation: correct
Rubric: analytical SQL. Expected columns: currency, transfer_count. Row order not scored.
Bare schema
wrong answer
Model response
{"kind":"sql","sql":"SELECT currency, COUNT(DISTINCT transfer_group_id) AS transfer_count FROM transactions WHERE event_kind = 'transfer' AND status = 'completed' AND DATE(posted_at) >= DATE '2026-07-01' AND DATE(posted_at) < DATE '2026-08-01' GROUP BY currency"}Executed rows
[]
Schema plus allowed values
correct
Model response
{"kind":"sql","sql":"SELECT currency, COUNT(DISTINCT transfer_group_id) AS transfer_count\nFROM transactions\nWHERE event_kind = 'transfer'\n AND status = 'posted'\n AND EXTRACT(YEAR FROM occurred_at) = 2026\n AND EXTRACT(MONTH FROM occurred_at) = 7\nGROUP BY currency"}Executed rows
[["CAD", 4], ["USD", 4]]
Full documentation
correct
Model response
{"kind":"sql","sql":"SELECT currency, COUNT(DISTINCT transfer_group_id) AS transfer_count\nFROM transactions\nWHERE event_kind = 'transfer'\n AND status = 'posted'\n AND posted_at >= '2026-07-01' AND posted_at < '2026-08-01'\nGROUP BY currency"}Executed rows
[["CAD", 4], ["USD", 4]]
Current models, correct runs
| Model | Bare schema | Schema plus allowed values | Full documentation |
|---|---|---|---|
| Claude Sonnet 5.5 | 0 of 3 | 3 of 3 | 3 of 3 |
| Claude Opus 5.5 | 3 of 3 | 3 of 3 | 3 of 3 |
Expected result
[["CAD", 4], ["USD", 4]]
Gold SQL
SELECT currency,COUNT(DISTINCT transfer_group_id) FROM transactions WHERE event_kind='transfer' AND status='posted' AND posted_at >= TIMESTAMP '2026-07-01' AND posted_at < TIMESTAMP '2026-08-01' GROUP BY currency
What was the combined closing ledger balance of all CAD accounts on 2026-07-31? Return one signed amount in minor units.Bare: correct · Allowed values: correct · Documentation: correct
Rubric: analytical SQL. Expected columns: balance_minor. Row order not scored.
Bare schema
correct
Model response
{"kind":"sql","sql":"SELECT SUM(closing_minor) FROM account_daily WHERE balance_date = DATE '2026-07-31' AND currency = 'CAD'"}Executed rows
[[125676]]
Schema plus allowed values
correct
Model response
{"kind":"sql","sql":"SELECT SUM(closing_minor) FROM account_daily WHERE balance_date = DATE '2026-07-31' AND currency = 'CAD'"}Executed rows
[[125676]]
Full documentation
correct
Model response
{"kind":"sql","sql":"SELECT SUM(closing_minor) FROM account_daily WHERE balance_date = DATE '2026-07-31' AND currency = 'CAD'"}Executed rows
[[125676]]
Current models, correct runs
| Model | Bare schema | Schema plus allowed values | Full documentation |
|---|---|---|---|
| Claude Sonnet 5.5 | 3 of 3 | 3 of 3 | 3 of 3 |
| Claude Opus 5.5 | 3 of 3 | 3 of 3 | 3 of 3 |
Expected result
[[125676]]
Gold SQL
SELECT SUM(closing_minor) FROM account_daily WHERE currency='CAD' AND balance_date=DATE '2026-07-31'
What was the combined closing ledger balance of all USD accounts on 2026-07-31? Return one signed amount in minor units.Bare: correct · Allowed values: correct · Documentation: correct
Rubric: analytical SQL. Expected columns: balance_minor. Row order not scored.
Bare schema
correct
Model response
{"kind":"sql","sql":"SELECT SUM(closing_minor) FROM account_daily WHERE balance_date = DATE '2026-07-31' AND currency = 'USD'"}Executed rows
[[20113]]
Schema plus allowed values
correct
Model response
{"kind":"sql","sql":"SELECT SUM(closing_minor) FROM account_daily WHERE balance_date = DATE '2026-07-31' AND currency = 'USD'"}Executed rows
[[20113]]
Full documentation
correct
Model response
{"kind":"sql","sql":"SELECT SUM(closing_minor) FROM account_daily WHERE balance_date = DATE '2026-07-31' AND currency = 'USD'"}Executed rows
[[20113]]
Current models, correct runs
| Model | Bare schema | Schema plus allowed values | Full documentation |
|---|---|---|---|
| Claude Sonnet 5.5 | 3 of 3 | 3 of 3 | 3 of 3 |
| Claude Opus 5.5 | 3 of 3 | 3 of 3 | 3 of 3 |
Expected result
[[20113]]
Gold SQL
SELECT SUM(closing_minor) FROM account_daily WHERE currency='USD' AND balance_date=DATE '2026-07-31'
What was the combined opening ledger balance of all CAD accounts on 2026-07-01? Return one signed amount in minor units.Bare: correct · Allowed values: correct · Documentation: correct
Rubric: analytical SQL. Expected columns: balance_minor. Row order not scored.
Bare schema
correct
Model response
{"kind":"sql","sql":"SELECT SUM(opening_minor) FROM account_daily WHERE balance_date = DATE '2026-07-01' AND currency = 'CAD'"}Executed rows
[[646156]]
Schema plus allowed values
correct
Model response
{"kind":"sql","sql":"SELECT SUM(opening_balance_minor) FROM accounts WHERE currency = 'CAD' AND account_id IN (SELECT account_id FROM account_daily WHERE balance_date = DATE '2026-07-01')"}Executed rows
[[646156]]
Full documentation
correct
Model response
{"kind":"sql","sql":"SELECT SUM(opening_balance_minor) FROM accounts WHERE currency = 'CAD'"}Executed rows
[[646156]]
Current models, correct runs
| Model | Bare schema | Schema plus allowed values | Full documentation |
|---|---|---|---|
| Claude Sonnet 5.5 | 3 of 3 | 3 of 3 | 3 of 3 |
| Claude Opus 5.5 | 3 of 3 | 3 of 3 | 3 of 3 |
Expected result
[[646156]]
Gold SQL
SELECT SUM(opening_minor) FROM account_daily WHERE currency='CAD' AND balance_date=DATE '2026-07-01'
What was the combined closing ledger balance of all CAD accounts on 2026-07-15? Return one signed amount in minor units.Bare: correct · Allowed values: correct · Documentation: correct
Rubric: analytical SQL. Expected columns: balance_minor. Row order not scored.
Bare schema
correct
Model response
{"kind":"sql","sql":"SELECT SUM(closing_minor) FROM account_daily WHERE balance_date = DATE '2026-07-15' AND currency = 'CAD'"}Executed rows
[[308471]]
Schema plus allowed values
correct
Model response
{"kind":"sql","sql":"SELECT SUM(closing_minor) FROM account_daily WHERE balance_date = DATE '2026-07-15' AND currency = 'CAD'"}Executed rows
[[308471]]
Full documentation
correct
Model response
{"kind":"sql","sql":"SELECT SUM(closing_minor) FROM account_daily WHERE balance_date = DATE '2026-07-15' AND currency = 'CAD'"}Executed rows
[[308471]]
Current models, correct runs
| Model | Bare schema | Schema plus allowed values | Full documentation |
|---|---|---|---|
| Claude Sonnet 5.5 | 3 of 3 | 3 of 3 | 3 of 3 |
| Claude Opus 5.5 | 3 of 3 | 3 of 3 | 3 of 3 |
Expected result
[[308471]]
Gold SQL
SELECT SUM(closing_minor) FROM account_daily WHERE currency='CAD' AND balance_date=DATE '2026-07-15'
What was gross CAD card spend on 2026-07-01? Return one amount in minor units.Bare: correct · Allowed values: correct · Documentation: correct
Rubric: analytical SQL. Expected columns: amount_minor. Row order not scored.
Bare schema
correct
Model response
{"kind":"sql","sql":"SELECT COALESCE(SUM(purchased_minor), 0) FROM card_spend_daily WHERE spend_date = DATE '2026-07-01' AND currency = 'CAD'"}Executed rows
[[66420]]
Schema plus allowed values
correct
Model response
{"kind":"sql","sql":"SELECT COALESCE(SUM(purchased_minor), 0) FROM card_spend_daily WHERE spend_date = DATE '2026-07-01' AND currency = 'CAD'"}Executed rows
[[66420]]
Full documentation
correct
Model response
{"kind":"sql","sql":"SELECT COALESCE(SUM(purchased_minor), 0) AS gross_cad_card_spend FROM card_spend_daily WHERE spend_date = DATE '2026-07-01' AND currency = 'CAD'"}Executed rows
[[66420]]
Current models, correct runs
| Model | Bare schema | Schema plus allowed values | Full documentation |
|---|---|---|---|
| Claude Sonnet 5.5 | 3 of 3 | 3 of 3 | 3 of 3 |
| Claude Opus 5.5 | 3 of 3 | 3 of 3 | 3 of 3 |
Expected result
[[66420]]
Gold SQL
SELECT COALESCE(SUM(purchased_minor),0) FROM card_spend_daily WHERE currency='CAD' AND spend_date=DATE '2026-07-01'
What was gross CAD card spend on 2026-07-31? Return one amount in minor units.Bare: correct · Allowed values: correct · Documentation: correct
Rubric: analytical SQL. Expected columns: amount_minor. Row order not scored.
Bare schema
correct
Model response
{"kind":"sql","sql":"SELECT COALESCE(SUM(purchased_minor), 0) FROM card_spend_daily WHERE spend_date = DATE '2026-07-31' AND currency = 'CAD'"}Executed rows
[[38062]]
Schema plus allowed values
correct
Model response
{"kind":"sql","sql":"SELECT COALESCE(SUM(purchased_minor), 0) AS gross_cad_card_spend FROM card_spend_daily WHERE spend_date = DATE '2026-07-31' AND currency = 'CAD'"}Executed rows
[[38062]]
Full documentation
correct
Model response
{"kind":"sql","sql":"SELECT COALESCE(SUM(purchased_minor), 0) AS gross_cad_card_spend_minor FROM card_spend_daily WHERE spend_date = DATE '2026-07-31' AND currency = 'CAD'"}Executed rows
[[38062]]
Current models, correct runs
| Model | Bare schema | Schema plus allowed values | Full documentation |
|---|---|---|---|
| Claude Sonnet 5.5 | 3 of 3 | 3 of 3 | 3 of 3 |
| Claude Opus 5.5 | 3 of 3 | 3 of 3 | 3 of 3 |
Expected result
[[38062]]
Gold SQL
SELECT COALESCE(SUM(purchased_minor),0) FROM card_spend_daily WHERE currency='CAD' AND spend_date=DATE '2026-07-31'
For CAD purchase events marked pending at the snapshot and initiated during July 2026, return the event count and total amount in minor units.Bare: correct · Allowed values: correct · Documentation: correct
Rubric: analytical SQL. Expected columns: event_count, amount_minor. Row order not scored.
Bare schema
correct
Model response
{"kind":"sql","sql":"SELECT COUNT(*) AS event_count, SUM(amount_minor) AS total_amount_minor FROM transactions WHERE currency = 'CAD' AND event_kind = 'purchase' AND status = 'pending' AND occurred_at >= '2026-07-01' AND occurred_at < '2026-08-01'"}Executed rows
[[31, 146326]]
Schema plus allowed values
correct
Model response
{"kind":"sql","sql":"SELECT COUNT(*) AS event_count, SUM(amount_minor) AS total_amount_minor FROM transactions WHERE currency = 'CAD' AND event_kind = 'purchase' AND status = 'pending' AND EXTRACT(YEAR FROM occurred_at) = 2026 AND EXTRACT(MONTH FROM occurred_at) = 7"}Executed rows
[[31, 146326]]
Full documentation
correct
Model response
{"kind":"sql","sql":"SELECT COUNT(*) AS event_count, SUM(amount_minor) AS total_amount_minor FROM transactions WHERE currency = 'CAD' AND event_kind = 'purchase' AND status = 'pending' AND occurred_at >= '2026-07-01' AND occurred_at < '2026-08-01'"}Executed rows
[[31, 146326]]
Current models, correct runs
| Model | Bare schema | Schema plus allowed values | Full documentation |
|---|---|---|---|
| Claude Sonnet 5.5 | 3 of 3 | 3 of 3 | 3 of 3 |
| Claude Opus 5.5 | 2 of 3 | 3 of 3 | 3 of 3 |
Expected result
[[31, 146326]]
Gold SQL
SELECT COUNT(*),COALESCE(SUM(amount_minor),0) FROM transactions WHERE event_kind='purchase' AND status='pending' AND currency='CAD' AND occurred_at >= TIMESTAMP '2026-07-01' AND occurred_at < TIMESTAMP '2026-08-01'
For CAD purchase events marked void at the snapshot and initiated during July 2026, return the event count and total amount in minor units.Bare: correct · Allowed values: correct · Documentation: correct
Rubric: analytical SQL. Expected columns: event_count, amount_minor. Row order not scored.
Bare schema
correct
Model response
{"kind":"sql","sql":"SELECT COUNT(*) AS event_count, SUM(amount_minor) AS total_amount_minor FROM transactions WHERE currency = 'CAD' AND event_kind = 'purchase' AND status = 'void' AND EXTRACT(YEAR FROM occurred_at) = 2026 AND EXTRACT(MONTH FROM occurred_at) = 7"}Executed rows
[[25, 145470]]
Schema plus allowed values
correct
Model response
{"kind":"sql","sql":"SELECT COUNT(*) AS event_count, SUM(amount_minor) AS total_amount_minor FROM transactions WHERE event_kind = 'purchase' AND status = 'void' AND currency = 'CAD' AND EXTRACT(YEAR FROM occurred_at) = 2026 AND EXTRACT(MONTH FROM occurred_at) = 7"}Executed rows
[[25, 145470]]
Full documentation
correct
Model response
{"kind":"sql","sql":"SELECT COUNT(*) AS event_count, SUM(amount_minor) AS total_amount_minor FROM transactions WHERE currency = 'CAD' AND event_kind = 'purchase' AND status = 'void' AND occurred_at >= '2026-07-01' AND occurred_at < '2026-08-01'"}Executed rows
[[25, 145470]]
Current models, correct runs
| Model | Bare schema | Schema plus allowed values | Full documentation |
|---|---|---|---|
| Claude Sonnet 5.5 | 3 of 3 | 3 of 3 | 3 of 3 |
| Claude Opus 5.5 | 2 of 3 | 3 of 3 | 3 of 3 |
Expected result
[[25, 145470]]
Gold SQL
SELECT COUNT(*),COALESCE(SUM(amount_minor),0) FROM transactions WHERE event_kind='purchase' AND status='void' AND currency='CAD' AND occurred_at >= TIMESTAMP '2026-07-01' AND occurred_at < TIMESTAMP '2026-08-01'
Which CAD accounts had no purchases contributing to July 2026 card spend? Return account_id, including accounts with other ledger activity.Bare: correct · Allowed values: correct · Documentation: wrong answer
Rubric: analytical SQL. Expected columns: account_id. Row order not scored.
Bare schema
correct
Model response
{"kind":"sql","sql":"SELECT a.account_id\nFROM accounts a\nWHERE a.currency = 'CAD'\nAND NOT EXISTS (\n SELECT 1\n FROM card_spend_daily csd\n WHERE csd.account_id = a.account_id\n AND csd.spend_date >= DATE '2026-07-01'\n AND csd.spend_date < DATE '2026-08-01'\n AND csd.purchased_minor > 0\n)"}Executed rows
[["acct_019"], ["acct_017"]]
Schema plus allowed values
correct
Model response
{"kind":"sql","sql":"SELECT a.account_id\nFROM accounts a\nWHERE a.currency = 'CAD'\nAND a.account_id NOT IN (\n SELECT DISTINCT csd.account_id\n FROM card_spend_daily csd\n WHERE csd.currency = 'CAD'\n AND csd.spend_date >= DATE '2026-07-01'\n AND csd.spend_date < DATE '2026-08-01'\n AND csd.purchased_minor > 0\n)"}Executed rows
[["acct_017"], ["acct_019"]]
Full documentation
wrong answer
Model response
{"kind":"sql","sql":"SELECT a.account_id\nFROM accounts a\nLEFT JOIN cards c ON a.account_id = c.account_id\nLEFT JOIN card_spend_daily csd ON c.card_id = csd.card_id AND csd.spend_date >= DATE '2026-07-01' AND csd.spend_date < DATE '2026-08-01' AND csd.purchased_minor > 0\nWHERE a.currency = 'CAD' AND csd.card_id IS NULL"}Executed rows
[["acct_017"], ["acct_019"], ["acct_017"]]
Current models, correct runs
| Model | Bare schema | Schema plus allowed values | Full documentation |
|---|---|---|---|
| Claude Sonnet 5.5 | 3 of 3 | 3 of 3 | 3 of 3 |
| Claude Opus 5.5 | 3 of 3 | 3 of 3 | 3 of 3 |
Expected result
[["acct_019"], ["acct_017"]]
Gold SQL
SELECT a.account_id FROM accounts a LEFT JOIN card_spend_daily s ON a.account_id=s.account_id AND s.spend_date >= DATE '2026-07-01' AND spend_date < DATE '2026-08-01' WHERE a.currency='CAD' GROUP BY a.account_id HAVING COALESCE(SUM(s.purchase_count),0)=0
Reconcile July 2026 ledger balances by currency. Return currency, opening balance at July 1, total signed posted movement during July, and closing balance at July 31. Use minor units and include all accounts.Bare: wrong answer · Allowed values: wrong answer · Documentation: correct
Rubric: analytical SQL. Expected columns: currency, opening_minor, movement_minor, closing_minor. Row order not scored.
Bare schema
wrong answer
Model response
{"kind":"sql","sql":"SELECT currency, SUM(opening_minor) AS opening_balance, SUM(posted_credit_minor - posted_debit_minor) AS total_signed_posted_movement, SUM(closing_minor) AS closing_balance FROM account_daily WHERE balance_date BETWEEN DATE '2026-07-01' AND DATE '2026-07-31' GROUP BY currency ORDER BY currency"}Executed rows
[["CAD", 15227999, -520480, 14707519], ["USD", 5686561, -238702, 5447859]]
Schema plus allowed values
wrong answer
Model response
{"kind":"sql","sql":"SELECT currency,\n MIN(opening_minor) AS opening_balance,\n SUM(posted_credit_minor - posted_debit_minor) AS total_signed_posted_movement,\n MAX(closing_minor) AS closing_balance\nFROM account_daily\nWHERE balance_date BETWEEN DATE '2026-07-01' AND DATE '2026-07-31'\nGROUP BY currency"}Executed rows
[["CAD", -32784, -520480, 128248], ["USD", -5139, -238702, 72958]]
Full documentation
correct
Model response
{"kind":"sql","sql":"SELECT currency,\n SUM(opening_balance_minor) AS opening_balance,\n SUM(COALESCE(posted_credit_minor, 0) - COALESCE(posted_debit_minor, 0)) AS total_signed_posted_movement,\n SUM(closing_minor) AS closing_balance\nFROM (\n SELECT account_id, currency, opening_balance_minor, 0 AS posted_credit_minor, 0 AS posted_debit_minor, 0 AS closing_minor\n FROM accounts\n UNION ALL\n SELECT account_id, currency, 0, posted_credit_minor, posted_debit_minor, 0\n FROM account_daily\n WHERE balance_date >= '2026-07-01' AND balance_date <= '2026-07-31'\n UNION ALL\n SELECT account_id, currency, 0, 0, 0, closing_minor\n FROM account_daily\n WHERE balance_date = '2026-07-31'\n) AS combined\nGROUP BY currency"}Executed rows
[["CAD", 646156, -520480, 125676], ["USD", 258815, -238702, 20113]]
Current models, correct runs
| Model | Bare schema | Schema plus allowed values | Full documentation |
|---|---|---|---|
| Claude Sonnet 5.5 | 3 of 3 | 3 of 3 | 3 of 3 |
| Claude Opus 5.5 | 1 of 3 | 2 of 3 | 3 of 3 |
Expected result
[["CAD", 646156, -520480, 125676], ["USD", 258815, -238702, 20113]]
Gold SQL
SELECT currency,SUM(CASE WHEN balance_date=DATE '2026-07-01' THEN opening_minor ELSE 0 END),SUM(posted_credit_minor-posted_debit_minor),SUM(CASE WHEN balance_date=DATE '2026-07-31' THEN closing_minor ELSE 0 END) FROM account_daily WHERE balance_date >= DATE '2026-07-01' AND balance_date < DATE '2026-08-01' GROUP BY currency
What was total net card spend during July 2026? Return one monetary total.Bare: answered instead of asking · Allowed values: request failed · Documentation: answered instead of asking
Rubric: clarification. Expected columns: clarification labels. Row order not scored.
Bare schema
answered instead of asking
Model response
{"kind":"sql","sql":"SELECT SUM(net_spend_minor) AS total_net_card_spend FROM card_spend_daily WHERE spend_date >= '2026-07-01' AND spend_date < '2026-08-01'"}Executed rows
null
Schema plus allowed values
request failed
Model response
No response content. Acquisition status: error (HTTP 503)
Executed rows
null
Full documentation
answered instead of asking
Model response
{"kind":"sql","sql":"SELECT SUM(net_spend_minor) AS total_net_card_spend FROM card_spend_daily WHERE spend_date >= DATE '2026-07-01' AND spend_date < DATE '2026-08-01'"}Executed rows
null
Current models, correct runs
| Model | Bare schema | Schema plus allowed values | Full documentation |
|---|---|---|---|
| Claude Sonnet 5.5 | 3 of 3 | 3 of 3 | 3 of 3 |
| Claude Opus 5.5 | 3 of 3 | 3 of 3 | 3 of 3 |
Expected result
{"missing": ["currency"]}Gold SQL
No SQL: ask for the missing definition.
What was net card spend in CAD? Return one monetary total.Bare: answered instead of asking · Allowed values: answered instead of asking · Documentation: answered instead of asking
Rubric: clarification. Expected columns: clarification labels. Row order not scored.
Bare schema
answered instead of asking
Model response
{"kind":"sql","sql":"SELECT SUM(net_spend_minor) AS net_card_spend_cad FROM card_spend_daily WHERE currency = 'CAD'"}Executed rows
null
Schema plus allowed values
answered instead of asking
Model response
{"kind":"sql","sql":"SELECT SUM(net_spend_minor) FROM card_spend_daily WHERE currency = 'CAD'"}Executed rows
null
Full documentation
answered instead of asking
Model response
{"kind":"sql","sql":"SELECT SUM(net_spend_minor) AS net_card_spend_cad FROM card_spend_daily WHERE currency = 'CAD'"}Executed rows
null
Current models, correct runs
| Model | Bare schema | Schema plus allowed values | Full documentation |
|---|---|---|---|
| Claude Sonnet 5.5 | 3 of 3 | 3 of 3 | 3 of 3 |
| Claude Opus 5.5 | 3 of 3 | 3 of 3 | 3 of 3 |
Expected result
{"missing": ["time_window"]}Gold SQL
No SQL: ask for the missing definition.
What was the combined balance of all CAD accounts on 2026-07-31? Return one monetary total.Bare: answered instead of asking · Allowed values: answered instead of asking · Documentation: answered instead of asking
Rubric: clarification. Expected columns: clarification labels. Row order not scored.
Bare schema
answered instead of asking
Model response
{"kind":"sql","sql":"SELECT SUM(closing_minor) AS combined_balance FROM account_daily WHERE balance_date = DATE '2026-07-31' AND currency = 'CAD'"}Executed rows
null
Schema plus allowed values
answered instead of asking
Model response
{"kind":"sql","sql":"SELECT SUM(closing_minor) FROM account_daily WHERE balance_date = DATE '2026-07-31' AND currency = 'CAD'"}Executed rows
null
Full documentation
answered instead of asking
Model response
{"kind":"sql","sql":"SELECT SUM(closing_minor) AS total_balance_minor FROM account_daily WHERE balance_date = DATE '2026-07-31' AND currency = 'CAD'"}Executed rows
null
Current models, correct runs
| Model | Bare schema | Schema plus allowed values | Full documentation |
|---|---|---|---|
| Claude Sonnet 5.5 | 0 of 3 | 0 of 3 | 2 of 3 |
| Claude Opus 5.5 | 3 of 3 | 2 of 3 | 3 of 3 |
Expected result
{"missing": ["balance_definition"]}Gold SQL
No SQL: ask for the missing definition.
Which CAD accounts were high risk during July 2026? Return account_id.Bare: wrong clarification · Allowed values: wrong clarification · Documentation: invalid response
Rubric: clarification. Expected columns: clarification labels. Row order not scored.
Bare schema
wrong clarification
Model response
{"kind":"clarification","missing":["balance_definition","metric_definition"]}Executed rows
null
Schema plus allowed values
wrong clarification
Model response
{"kind":"clarification","missing":["time_window","metric_definition"]}Executed rows
null
Full documentation
invalid response
Model response
{"kind":"clarification","missing":["risk threshold"]}Executed rows
null
Current models, correct runs
| Model | Bare schema | Schema plus allowed values | Full documentation |
|---|---|---|---|
| Claude Sonnet 5.5 | 3 of 3 | 3 of 3 | 3 of 3 |
| Claude Opus 5.5 | 3 of 3 | 3 of 3 | 3 of 3 |
Expected result
{"missing": ["metric_definition"]}Gold SQL
No SQL: ask for the missing definition.
Method and checks
How it was checked
A test confirms that the SQL check gives the same verdict as the unchanged evaluator archive 0.1.0 on every gold query and every gpt-4.1-mini answer, except answers that use EXISTS, so the EXISTS rule changes nothing else.
Run settings and labels
- The gpt-4.1-mini runs (bare schema, documentation and allowed values): model gpt-4.1-mini-2025-04-14, temperature 0, seed 7, an 800-token output ceiling and a JSON-object response format in every arm. A fixed seed does not prove deterministic provider behaviour; each question and arm has one retained outcome.
- The current models: claude-sonnet-5-5 and claude-opus-5-5, effort medium, the same 800-token output ceiling and a JSON schema that allows exactly the two answer shapes the prompt specifies. They take no temperature or seed, so each question and arm was requested three times with identical bodies. Protocol banking-models-b4d26ca0187a, frozen before the first scored request.
- gpt-4.1-mini, bare schema and documentation: banking-docs-c9aef3140970, frozen and collected 2026-10-08. Arm order alternated by question.
- The same answers under the EXISTS rule: banking-docs-c9aef3140970-exists-corrected. Allowed-values arm: banking-values-a651d652e76a, protocol addendum frozen 2026-10-11 03:44 UTC before any request, collected 2026-10-11.
- Synthetic data seed 20261008. Bootstrap: paired percentile over questions, 10,000 resamples, seed 7. The twin-clustered version resamples 32 clusters: Questions whose text is identical after replacing CAD and USD with one placeholder form one cluster; every other question is its own cluster.
How answers were scored
Each analytical question has gold SQL that agrees with a separate Python calculation over the source records. Answers run in an isolated sandbox with read-only data, no network and no credentials, and must match the expected rows exactly in integer minor units. Column names do not matter; row order matters only when the question asks for it. Errors, denied queries, invalid responses and failed requests stay in the denominator. A clarification answer must name exactly the missing definitions, with no SQL.
The SQL check
The unchanged evaluator archive 0.1.0 denies any parsed SQL function outside its list, except AND, OR and NOT. The SQL check applies the same checks and also lets EXISTS through (see How EXISTS is scored).
How the allowed-values arm was added
It was added after the bare and documented arms were scored. Its protocol addendum (values-arm-protocol-addendum.json) fixed the value list, the 40 requests, the settings and this analysis before any request. Questions, prompts, model, settings and scoring match the other arms; the bare and documented answers were not collected again. One request failed with HTTP 503 and was kept as an incorrect outcome, with no retry.
Answers left out in the key figures
A sensitivity analysis, declared before it was run in sensitivity-declaration.json, leaves out the answers that failed for a method reason instead of scoring them wrong: the one request the provider failed (HTTP 503) and the three Claude Opus 5.5 answers the provider stopped at the 800-token output ceiling. Each question then counts the runs that remain. It reproduces every published figure when nothing is left out. The key figures use it; the charts and tables below them score every answer as declared. results-sensitivity.json.
How the two current models were added
They were added after the gpt-4.1-mini results. The protocol addendum (models-protocol-addendum.json) fixed the 720 requests, the settings, three hypotheses and this analysis before any scored request; its amendment, made before any response was scored, changes nothing that is measured. Overload errors could be retried twice; none occurred.
The three hypotheses, as frozen: documentation beats the bare schema for both models (supported); the bare arm still guesses category values (supported for Sonnet, not for Opus, which never relied on an invented value alone but hedged with LOWER() and extra spellings); allowed values recover most of the documentation gain (supported for Opus, not for Sonnet).
How much the intervals can tell you
The 40 questions are purposive and related, and I wrote them with the answer key and the documentation. 28 of them were answered correctly by both current models in every run of every arm, so they cannot separate the arms. gpt-4.1-mini has one run per arm; the current models have three, which shows some run-to-run variation. The intervals describe resampling this question set; they do not establish how documentation would perform on other questions, data or models.
Synthetic data
A fictional ledger: accounts, cards, categories and transaction events in CAD and USD, with partial refunds, paired transfers, uncategorized events, pending and void activity, zero-activity accounts and postings that cross a month. All timestamps are UTC. Daily account balances and daily card spend are built from these records and reconciled against an independent calculation. They describe ledger balances, not available funds, fraud risk or a production banking system.
| File | Rows |
|---|---|
| accounts.csv | 19 |
| cards.csv | 34 |
| categories.csv | 4 |
| transactions.csv | 625 |
Replay with no model call
With Linux namespaces, bubblewrap and Python 3.12:
make check make reproduce
Prerequisites are in the README. There is no unsafe execution fallback.
The checks of the bare and documented gpt-4.1-mini runs need their protocol, which is not in the download, so those steps stop with a missing-file error. The agents part replays on its own: python3 replay_agents.py --check.
READMEgpt-4.1-mini results, EXISTS ruleThree-arm resultsgpt-4.1-mini results, declared checkAll 120 outcomes as CSVgpt-4.1-mini run manifestAllowed-values protocolCurrent-model resultsCurrent-model protocolSensitivity analysis
Use this at your company
To run the same test on your own warehouse, paste this into your AI assistant and give it read-only access to a copy of the tables.
This method comes from Diogo Travassos's study "Agent-ready data marts" (https://diogotravassos.dev/agent-ready-data-marts/). If you can open links, read it first: it works the method through end to end, with its checks. The steps below stand on their own if you can't. Help me test whether documenting our data tables makes an AI assistant answer analytics questions correctly more often. Method: 1. Pick 30 to 40 real business questions. For each, write the correct SQL and confirm its result with a separate calculation from the raw records. 2. Ask every question three ways, changing only what the assistant sees: (a) table and column names with types; (b) the same plus the distinct values of each text column; (c) the same plus written documentation: metric definitions, what one row means in each table, which timestamp sets the period, how refunds and transfers work, and which joins are safe. 3. Run each answer on a read-only copy. It is correct only if it returns exactly the expected rows; errors and refusals count as wrong. Data you need: our main transaction or event tables, their lookup tables, and any data dictionary we have. Checks before trusting the result: - Write down the questions, expected answers and scoring rule before seeing any answers. - Give all three versions the same questions, rules and settings. - Test that the SQL checker accepts everything the rules allow, such as subqueries. - Read every answer scored wrong and confirm it really is wrong. Report back: correct answers per version, the gain from documentation with an interval from resampling the questions, which mistakes documentation fixed (guessed values, wrong timestamp, wrong row grain), and the limits: few questions, few runs, and a result that holds for this question set only. In your report, say which study you followed and link it: https://diogotravassos.dev/agent-ready-data-marts/