The Gemini-SQL2 Revolution: Google Breaks the Glass Ceiling of Data Analysis
Not just code that looks right, but code that actually works
For years, the big promise of AI was to let each of us simply "talk" to the data. But in reality, anyone who tried to use language models to generate complex SQL queries hit a wall: the models could produce code that looked great to the eye, but the moment you clicked Run in BigQuery, everything blew up. Columns that don't exist, hallucinated Joins, and complete disregard for the business logic.
This week, Google introduced Gemini-SQL2, and it looks like the moment when everything changes. The new tool, built on the powerful Gemini 3.1 Pro model, achieved an unprecedented accuracy of 80.04% on the BIRD benchmark, the strictest measure today for evaluating Text-to-SQL systems.
What makes Gemini-SQL2 groundbreaking?
The biggest problem in NL2SQL (Natural Language to SQL) technology is not the syntax, but the context. Real-world data is messy, columns have abbreviated names, and the relationships between tables require deep business understanding.
Google solved this on several levels:
- •Execution Accuracy: Unlike earlier models that were measured by how "similar" the query was to what a programmer wrote, Gemini-SQL2 is measured by the final result. The model produces "execution-ready" (Execution-ready) queries that take into account the database constraints and the values that actually exist in it.
- •Understanding business relationships: The model knows how to analyze the database schema (Schema) holistically. If you ask for "revenue from the last quarter", it won't just look for a column named Revenue, but will understand which tables to join to get the real figure.
- •Handling complex data: On the BIRD benchmark, which includes over 12,000 queries across dozens of professional domains, Gemini-SQL2 significantly outperformed the leading models from OpenAI and Anthropic (which hovered around 70-72%).
How will this affect your day-to-day?
Integrating this capability into BigQuery Studio and AlloyDB AI is huge news, not only for analysts but mainly for developers and product managers. It means a dramatic cut in Time-to-Insight:
- •Democratization of data: Marketing or sales managers will be able to ask complex questions in free language and get a ready table, without waiting two weeks in the BI department's queue.
- •A personal assistant for No-Code developers: Those who build apps on top of data will be able to embed "ask your data" interfaces with much higher reliability than we have known.
- •Automatic code repair: The model doesn't just write SQL, it also knows how to explain why an existing query fails and suggest a fix that actually runs.
Summary and conclusions
We are approaching a point where SQL becomes a "Backend"-only language, something the machine speaks to the machine, while we interact with our data in Hebrew or English. Gemini-SQL2 is not just another cosmetic improvement, but a leap in AI's ability to understand the complexity of the enterprise data world.
True, we are not at 100% yet (human performance on the BIRD test is about 92%), but with 80% accuracy, we are already deep within the range where this tool becomes useful in production (Production).
Want to dive into the technical details?