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.6184
2Anthropic: Claude Opus 4.7182
3OpenAI: GPT-5.4175
4Z.ai: GLM 5.2174
5DeepSeek: DeepSeek V4 Pro172

See full SQL Generation rankings →