Code

Best AI Model for SQL Generation (2026)

Writing correct, performant SQL from natural-language prompts.

Writing correct, performant SQL from natural-language prompts. Scored by capability match + benchmark data + pricing.

#ModelScore
1Anthropic: Claude Sonnet 4.6186
2Anthropic: Claude Opus 4.7183
3OpenAI: GPT-5.4178
4OpenAI: GPT-5178
5Google: Gemini 3.1 Pro Preview176

See full SQL Generation rankings →