Skip to content
benchtopia
  • Fetching the field guide…

Code · Best AI for

SQL and databases

Writing and fixing queries, designing tables, and explaining what a slow query is doing.

Answer: Gemini 4 Neon (Google)

Gemini 4 Neon from Google is the best pick today (91/100), followed by Claude Fable 5.2 and Gemini 4 Carbon. None of the public tests we track is about SQL alone, so this mixes general coding (most of the weight) with a little math and office-style data work.

Honest note: No benchmark here tests SQL directly. Treat this as 'strong all-round coder', which is what matters most for SQL anyway.

Top 15 for SQL and databases

Score = share of today's AI models it beats on the tests below (100 = best of all).

  1. 1Gemini 4 NeonGoogle · a few tests91
  2. 2Claude Fable 5.2Anthropic · a few tests91
  3. 3Gemini 4 CarbonGoogle · a few tests89
  4. 4GPT-6 AstraOpenAI · plenty of tests88
  5. 5Claude Opus 5.5Anthropic · plenty of tests85
  6. 6GPT-6.1 SolOpenAI · a few tests83
  7. 7Gemini 4 HydrogenGoogle · a few tests82
  8. 8Claude Opus 5Anthropic · a few tests80
  9. 9Claude Sonnet 5.5Anthropic · a few tests80
  10. 10Claude Fable 5.1Anthropic · a few tests79
  11. 11Claude Fable 5Anthropic · a few tests78
  12. 12Gemini 4 ArgonGoogle · plenty of tests74
  13. 13GPT-6 SolOpenAI · a few tests73
  14. 14Muse WonderMeta · a few tests69
  15. 15Claude Opus 4.8Anthropic · a few tests66

Best overall

Gemini 4 Neon

Score 91 · Google · $0.033 per job

Best under $1

Claude Haiku 5.5

Score 62 · Anthropic · $0.0011 per job

Best open source

DeepSeek V4.1 Flash

Score 58 · DeepSeek · <$0.001 per job

What it costs to write one tricky query from a schema

≈ 6K tokens read and 1K written per job, at each model's list API price. Monthly chat-app plans don't charge per job.

ModelScorePer jobPer 1,000 jobsMemory
Gemini 4 Neon91$0.033$33.001M
Claude Fable 5.291$0.088$88.001M
Gemini 4 Carbon89$0.022$22.001M
GPT-6 Astra88$0.11$1101.1M
Claude Opus 5.585$0.044$44.001M
GPT-6.1 Sol83$0.022$22.001.1M
Gemini 4 Hydrogenbest value82$0.017$16.501M
Claude Opus 580$0.055$55.001M
Claude Sonnet 5.580$0.022$22.001M
Claude Fable 5.179$0.11$1101M
Claude Fable 578$0.11$1101M
Gemini 4 Argon74$0.022$22.001M
GPT-6 Sol73$0.022$22.001.1M
Muse Wonder69$0.044$44.001M
Claude Opus 4.866$0.055$55.001M

Highlighted: the cheapest model within 15% of the top score.

Tests behind this ranking

Share = how much each test counts towards the score.

FrontierCodeWould a project's real owner actually accept the AI's code?10%
FrontierSWECan it finish huge engineering projects that take most of a day?9%
DeepSWECan it build big new features in code nobody has solved online?9%
CursorBenchHow well does it help real coders inside the Cursor code editor?8%
SWE-bench MultilingualCan it fix real bugs in projects written in many coding languages?7%
MirrorCodeCan it rebuild a whole program just by watching what it does?6%
Terminal-BenchCan it get real jobs done by typing commands in a terminal?5%
GDPvalIs its work as good as a real expert's?5%
GDP.pdfCan it really read the tricky PDFs people use at work?5%
FrontierMath Tiers 1–3 (v2)Can it crack hard, brand-new math problems (fixed edition)?4%
FrontierMath Tier 4 (v2)Can it solve research-level math problems (fixed edition)?4%
APEX-AgentsCan it do the work of a banker, consultant or lawyer?4%

Tips

  • Paste your table definitions (CREATE TABLE …) into the chat. Guessed column names are the #1 source of wrong queries.
  • Ask it to explain the query plan when something is slow. It's good at that.

Quick answers

What's the best AI for writing SQL?

Gemini 4 Neon from Google is the best pick today (91/100), followed by Claude Fable 5.2 and Gemini 4 Carbon.

About Gemini 4 Neon →
What's the best cheap AI for SQL and databases?

Claude Haiku 5.5: 62/100 for about $0.2 per million tokens. One job (write one tricky query from a schema) costs about $0.0011.

See the details →
What's the best open-source AI for SQL and databases?

DeepSeek V4.1 Flash from DeepSeek, scoring 58/100. You can download it and run it yourself.

See the details →
How much does it cost to write one tricky query from a schema with AI?

With Gemini 4 Neon, about $0.033 (≈ 6K tokens read, 1K written, at list API prices). Gemini 4 Hydrogen scores nearly as well for $0.017. Chat apps on a monthly plan don't charge per job.

How is this decided?

None of the public tests we track is about SQL alone, so this mixes general coding (most of the weight) with a little math and office-style data work. No benchmark here tests SQL directly. Treat this as 'strong all-round coder', which is what matters most for SQL anyway.

How scores work →

Related