Why Learn SQL When an LLM Can Draft It?

Concept. An LLM can draft SQL quickly. You still have to define what the question means. Executable SQL can encode the wrong interpretation.

Intuition. Ask for the users who don't listen to Taylor Swift. Does a collaboration count? Does one play count, or only a favorite? Does Pluto, who played nothing, count? Two times four times two produces sixteen queries. Every one runs, and they do not agree.

One English Sentence Hides Sixteen Queries

The sentence leaves three choices open: how to match Taylor Swift, what counts as a listen, and whether a user with no plays counts as a non-listener.

This is the simplest example in our data, where LLMs can make up several open choices on your behalf. In production data systems (below), the missing context lead to wrong results.

One English sentence, find users who don't listen to Taylor Swift, hides three independent decisions that multiply to 2 times 4 times 2 equals 16 valid queries, drawn as a grid of 16 cells that all run. Two are labelled to show how far apart the answers are: one returns just Pluto, another returns all four. An orange ring marks the square the model landed on this run; the pick can move on another run or another model.

Figure 1. Three independent choices produce sixteen executable queries. One returns only Pluto. Another returns all four users. The SQL defines which interpretation the model chooses. The English request is vague about what the user intends.

What BIRD and BEAVER Measure

BIRD, the industry-standard text-to-SQL benchmark. Competitors include OpenAI, Anthropic, Google, Databricks, Snowflake, Amazon, Alibaba, Tencent, ByteDance, and Huawei. It has 12,751 questions over 95 real databases, 33 GB, across 37 domains. Execution accuracy of the best systems: about 80% on BIRD, with evidence supplied; 10.8% on BEAVER with no hints; 30.1% on BEAVER with all hints, same model.

Figure 2. BIRD has 12,751 questions over 95 real databases (33 GB, 37 domains), and each question comes with an evidence string that supplies the definitions it needs: the best systems reach about 80%, humans 93%. BEAVER has 9,128 queries over 812 tables from three private enterprise warehouses, with SQL from production query logs, and withholds those definitions: the best agent frameworks on a frontier model reach 10.8%. Give the same model perfect knowledge of every subtask (the right tables, join keys, column mappings, and domain knowledge) and it reaches 30.1%. The model is unchanged; the missing structure is the gap.

The Missing Definitions

Both benchmarks expose the same requirement: business definitions that connect an English request to the intended query. Anthropic built those definitions into its analytics stack.