Text-to-SQL
Text-to-SQL is a technology that turns a question written in everyday language into a SQL query that a database can run. In research it is a classic semantic parsing task, and the Spider dataset released by Yale researchers in 2018 became one of its best-known benchmarks.[1][5][9] Large language models (LLMs) have raised accuracy sharply, and companies now build internal chat tools that let non-developers look up data.[6][8] On real company databases, however, accuracy is clearly lower than on clean benchmarks, so these tools are used with human review of the generated queries.[4][7][8]
What does Text-to-SQL mean in simple terms?
Text-to-SQL takes a question such as "What was our best-selling product last month?" and rewrites it in SQL (Structured Query Language), the language databases understand. It closes a common gap: the data sits in company databases, but only a few people can write SQL. Today the usual approach is to give an LLM the table structure (the schema), example queries and business terms, and let it write the query.[6][7][9] Checking whether the generated query is actually correct is still a human job.[6][7]
How can Text-to-SQL be explained with an analogy?
It works like a floor manager in a restaurant who takes your order in plain words and passes it to the chef in kitchen shorthand. If the manager mishears, the wrong dish arrives, so someone still has to check the order.
Where is Text-to-SQL used?
Uber — QueryGPT, an internal query tool
Uber described QueryGPT, an internal tool that generates SQL from natural-language prompts, in September 2024; the idea started at an internal generative AI hackathon in May 2023.[6] It uses "workspaces" that group tables and sample queries by business domain, plus separate LLM agents that classify intent, pick tables and prune unneeded columns.[6] Uber's data platform handles about 1.2 million interactive queries a month.[6] In a limited release to some Operations and Support teams, QueryGPT averaged about 300 daily active users.[6]
Result: About 78% of users said the generated queries cut the time they would have spent writing them; Uber's own conservative estimate is about 10 minutes to write a query by hand versus about 3 minutes with QueryGPT (an estimate, not a measured result).[6]
Pinterest — Built into an internal SQL tool
Pinterest added Text-to-SQL to Querybook, its open-source SQL query tool where most of its data analysis happens.[7] Because users struggled to find the right tables among hundreds of thousands in the data warehouse, it added retrieval-augmented (RAG) table search based on table summaries and past queries.[7] As the implementation improved and users got used to it, the share of generated SQL accepted on the first try rose from 20% to above 40%.[7]
Result: In Pinterest's real-world data, SQL-writing tasks were completed 35% faster with AI assistance; Pinterest notes this comparison does not control for differences between tasks.[7]
LinkedIn — An internal Text-to-SQL chatbot for many roles
LinkedIn built an internal chatbot that lets product managers, engineers and operations teams get data insights on their own.[8] It builds a knowledge graph from database metadata, query logs, wikis and code, and uses an agent that retrieves context, writes the query and automatically fixes hallucinations and syntax errors.[8] The chatbot has more than 300 weekly users.[8]
Result: In expert review on an internal benchmark, 53% of responses were judged correct or close to correct (2025 paper).[8]
Woowa Brothers (Korea) — The AI data analyst "Mureobose"
Woowa Brothers, the company behind the Korean delivery app Baemin, built "Mureobose", a Slack bot that generates, explains and checks SQL from plain-language questions.[9] It combines RAG with Text-to-SQL, using table metadata, a business glossary and example queries, and the team ran more than 500 A/B tests on an internal leaderboard to improve it.[9] In 2025 it was rebuilt as a multi-agent system using the ReAct pattern and expanded to company-wide knowledge beyond data questions.[10]
Result: The query generation feature answered in 30 seconds to 1 minute (2024); by October 2025, about one in four employees used Mureobose in their work.[9][10]
Try it today
- Paste the table definitions (CREATE TABLE statements, no real customer data) for one of your team's tables into an AI chatbot your company allows, ask one question, and look at the SQL it writes.
- Open the Spider dataset viewer on Hugging Face and skim how natural-language questions are paired with SQL.[11][1]
- Run generated queries first on a database copy or sample using read-only permissions before considering production execution. Also check query cost and access to sensitive rows.
- Make a short checklist: do the tables and columns really exist, and do filter values match real values (for example "WEB" vs "web", or "Completed" vs "Finished")?[6][7]
- Read Uber's or Woowa Brothers' write-up and list what your organization would need: documented schemas, a business glossary and verified example queries.[6][9]
Limits and direction
The main limit is the gap between benchmarks and real work. When the Spider 2.0 paper was published, its o1-preview-based agent solved only 21.3% of enterprise-style tasks, compared with 91.2% on Spider 1.0 and 73.0% on BIRD.[4] Leaderboard scores have risen fast since then: as checked on October 14, 2026, top Spider 2.0-Snow entries score above 90% and the top Spider 2.0-Lite entry about 76%, while on BIRD the best test score is 82.95% against 92.96% for human experts.[5][3][2] These are team-submitted scores on prepared benchmark data. Inside a company the picture is harder: LinkedIn's chatbot was correct or close to correct on 53% of its internal benchmark.[8] Pinterest noted that benchmarks use a small number of clean, pre-selected tables, unlike real warehouses.[7] Models also make up tables or columns that do not exist; Uber calls this an area it has not fully solved.[6] Short or vague questions and company-specific jargon lower accuracy further.[6][9]
Two directions stand out. First, a shift from one-shot translation to agents that explore the schema, run queries and fix their own errors, as in the Spider 2.0 agent setting, LinkedIn's self-correcting agent and Woowa Brothers' move to ReAct.[4][8][10] Second, competition on context quality: LinkedIn retrieves context from a knowledge graph, and Pinterest found that table search hit rate rose from 40% without table documentation to as high as 90% when documentation was weighted in.[8][7] The lesson so far is that the quality of schema documentation and business context often matters as much as the model itself.
Which sources explain Text-to-SQL?
- arXiv — Spider: A Large-Scale Human-Labeled Dataset for Complex and Cross-Domain Semantic Parsing and Text-to-SQL Task (Yu et al., Yale, 2018-09-24) — https://arxiv.org/abs/1809.08887
- arXiv — Can LLM Already Serve as A Database Interface? A BIg Bench for Large-Scale Database Grounded Text-to-SQLs (BIRD, 2023-05-04) — https://arxiv.org/abs/2305.03111
- BIRD-bench — BIRD-SQL leaderboard, execution accuracy (checked 2026-10-14) — https://bird-bench.github.io/
- arXiv — Spider 2.0: Evaluating Language Models on Real-World Enterprise Text-to-SQL Workflows (2024-11-12, revised 2025-03-17) — https://arxiv.org/abs/2411.07763
- XLANG Lab — Spider 2.0 project page and leaderboard (checked 2026-10-14) — https://spider2-sql.github.io/
- Uber Engineering — QueryGPT: Natural Language to SQL Using Generative AI (2024-09-19) — https://www.uber.com/us/en/blog/query-gpt/
- Pinterest Engineering — How we built Text-to-SQL at Pinterest (2024-04-02) — https://medium.com/pinterest-engineering/how-we-built-text-to-sql-at-pinterest-30bad30dabff
- arXiv — Text-to-SQL for Enterprise Data Analytics (LinkedIn, 2025-07-18) — https://arxiv.org/abs/2507.14372
- Woowa Brothers Tech Blog — AI data analyst "Mureobose" Part 1: Using RAG and Text-to-SQL (2024-07-12) — https://techblog.woowahan.com/18144/
- Woowa Brothers Tech Blog — AI data analyst "Mureobose" Part 3: Sharing knowledge with agents (2025-10-15) — https://techblog.woowahan.com/23273/
- Hugging Face — xlangai/spider dataset viewer — https://huggingface.co/datasets/xlangai/spider
Tell us what you think
Your feedback helps us improve the content.