Yardstick 600 generated SQL queries, all executed for real
Aakash Mehta Email LinkedIn Code and data Full write-up
Skip to the quiz ↓Teams decide an AI is safe to put near their data using one number: how often it gets the answer right. That number cannot tell you whether anyone would notice when it is wrong. A model that fails loudly at 80 percent accuracy is safer than one that fails silently at 90.
So this study measures the second thing, with the hypothesis and the statistics committed to version control before any data was collected.
Companies now let AI write . When it gets one wrong, it rarely breaks. The query runs fine and quietly returns wrong numbers, and those numbers go into somebody's report.
So I had AI write 600 queries, ran every one against a real database, and checked them against human answers. Then I counted how many of the wrong ones anybody could have spotted.
A silent failure is a query that runs perfectly, reports no error, and gives you the wrong numbers anyway. Nothing looks broken. There is no red text, no warning, no crash. The numbers just go into somebody's report.
That is the kind of mistake this study is about, and it is the kind you are about to try to catch by eye. 93 of the 104 mistakes here were this kind.
swipe the chart sideways →
That is the whole finding. A query that crashes gets investigated. A query that returns believable wrong numbers goes into a dashboard. The second kind is a , and it accounted for 82 to 97 percent of every mistake in this study. The share went up as the models got better, which is the part worth worrying about.
Everything below is the raw evidence. Filter all 600 runs by , difficulty or outcome, click any row to see the human answer next to the machine one, or write your own SQL against the results.
| Variant | Tier | Database | Question | Outcome | Conf | Rows |
|---|
A study about writing SQL ought to let you write some. This runs a real query engine in your browser, hand-written for this page, over all 600 runs.
Accuracy scores cannot help you here, because the failures they miss are exactly the ones that look fine. You need a check that runs on every query and does not get tired.
Send the same question to more than one model setup and compare the rows they come back with. When they all agree, move on. When they disagree, have a person look.
This study used four model setups (two models, two prompts each). They disagreed on 28 percent of questions (42 of 150), and that 28 percent contained 84% of every mistake made (87 of 104). Four calls per question instead of one, still about a tenth of a cent at list prices, and roughly three quarters of questions never need a human at all.
The honest caveat: this was measured on one benchmark, at one point in time, and it was never deployed anywhere. A cheaper version with only two setups was not measured separately. Test it on your own queries before you trust it.