Problem
Many people who work with company data cannot write SQL and have no time to learn it. Text-to-SQL tools turn a plain-language question into a query, but the model can return a wrong query with no warning, and nothing guarantees the script runs. A user who cannot read SQL will not notice the error, and a wrong query can be critical for the data. A team that wants to try such a tool needs a quick way to see how often it fails.
Example from the article: two tools, SQLCoder and SQLthroughAI, solved 26 graded SQL exercises on a flights and an Airbnb-style database, with questions written in Russian.
Solution in brief
Take exercises with known correct answers, give each tool the same schema, ask in the users' own language, and grade every generated query by difficulty level. Both tools solved about two thirds of the tasks (65% and 69%), so they suit helper and idea-generator roles, not replacing SQL knowledge.
Questions this case answers
- How to compare candidate natural-language-to-SQL generators cheaply, using graded exercises with known correct answers instead of building a benchmark
- How to decide whether a natural-language-to-SQL assistant is reliable enough for users who cannot check the generated query themselves
- How to compare two ready-made text-to-SQL tools on a small set of graded SQL exercises?
- How to tell whether a text-to-SQL tool is safe to give to people who do not know SQL?
Tools and methods
- SQLCoder (Defog) — open 15B-parameter model fine-tuned from StarCoder; can be downloaded, run in Colab or tried on a demo site.
- SQLthroughAI — free web tool built on OpenAI technology; no API key, schema entered in the web interface.
- sql-academy — source of graded exercises; its checker accepts only MySQL answers.
- sql-eval — Defog's own framework for judging whether generated queries are correct.
Google or a one-time email code. No password.