Key answer
Text-to-SQL turns a plain-language question into a SQL query against your schema, run over a governed, read-only data layer. AI writes the query and explains it; you confirm the logic and the result. It widens who can ask questions of data without widening who can break it.
Text-to-SQL turns a plain-language question into a SQL query against your schema, run over a governed, read-only data layer. AI writes the query and explains it; you confirm the logic and the result. It widens who can ask questions of data without widening who can break it, which is the whole point of doing it safely.
See a question become a query#
Type a business question, get the query it produces. AI writes; you confirm.
Plain-language question to SQL, live
| Business question | What the SQL returns |
|---|---|
| Top 5 products by revenue last quarter | SELECT … ORDER BY revenue DESC LIMIT 5 |
| Monthly active customers this year | COUNT(DISTINCT customer) GROUP BY month |
| Refund rate by region | SUM(refunds)/SUM(orders) GROUP BY region |
| Churned customers last 90 days | WHERE last_order < now() – 90d |
The value is access: a manager can ask ‘refund rate by region’ and get an answer in seconds, with the SQL shown so an analyst can check it. The question-asking widens; the query-writing burden shrinks.
Why routine querying is automating#
of descriptive and diagnostic analytics will be automated by 2027, routine querying included
Gartner expects 90% of descriptive and diagnostic analytics to be automated by 2027, and routine querying is squarely in that. But strong is not flawless: on the BIRD benchmark, the best single model reached about 80% execution accuracy in June 2026, against a human-expert baseline near 93%, so roughly one query in five can still be wrong. That is exactly why the generated SQL is shown for review, never trusted blind. Analysts move from writing queries to reviewing them and doing the harder modelling. The trusted data layer this runs over starts with Auto-EDA and data-quality scoring.
AI text-to-SQL vs human accuracy (BIRD)
The guardrails that keep it safe#
The guardrails that keep it safe
Read-only, schema-aware, explained, and logged. These four controls are what let you open data access without opening data risk, the same governance posture as the executive operating model.
Ticket queue vs self-serve#
Ticket queue vs self-serve
The shift is from an analyst-only ticket queue to governed self-serve: the business asks directly, analysts do harder work, and every query is logged. Access widens; control holds.
Build a governed text-to-SQL layer#
Practical GenAI in Data Analytics ships a text-to-SQL library over a governed read-only layer in Session 2. You leave able to let the business ask, safely.
Key takeaways
- Text-to-SQL turns a plain-language question into a query against your schema.
- Run it over a governed, read-only layer so access widens but risk does not.
- AI writes and explains the SQL; the analyst confirms logic and result.
- Log every query; show the SQL so the answer can be checked.
Questions, answered
What is text-to-SQL?
Is it safe to let the business write queries this way?
Does text-to-SQL always get the query right?
How accurate is AI text-to-SQL today?
Does this make SQL skills obsolete?
Dr. Ahmed El-Shamy
Co-founder, CEO and Dean of Education, Digisoul
Dr. Ahmed El-Shamy is Co-founder, CEO and Dean of Education at Digisoul. He has more than a decade across AI, fraud risk, and FP&A, and teaches Practical GenAI in FP&A bilingually across MENA, the GCC, and Africa, governed by Digisoul's ISO/IEC 42001:2023-certified AI Management System. Read the leadership profile.
Sources
- Gartner · by 2027, 90% of descriptive and diagnostic analytics in finance will be automated (2023 prediction). https://www.gartner.com/en/newsroom/press-releases/2023-03-01-gartner-preditcts-three-ways-autonomous-technologies-will-impact-the-fpanda-and-controller-functions-in-
- Google Research, via MarkTechPost · text-to-SQL best single model 80.04% vs 92.96% human on BIRD (Jun 2026). https://www.marktechpost.com/2026/06/12/google-releases-gemini-sql2-gemini-3-1-pro-text-to-sql-scores-80-04-on-bird-single-model-leaderboard/
- Practical GenAI in Data Analytics (Session 2: text-to-SQL library). https://digisoul.io/ai4x/genai-in-data-analytics/
AI Agent · Built on Claude · Operated on Zoho One