Codd AI

Glossary

Text-to-SQL

Definition

Text-to-SQL is the use of AI to translate a plain-language question into a SQL query that runs against a database.

What it means in practice

Modern language models write SQL well, which makes text-to-SQL demos impressive. In real enterprises, though, the difficult part is knowing which tables, joins and rules reflect what the business means.

Text-to-SQL on raw schemas often produces plausible but wrong answers. Grounding it in a semantic layer, so the AI works from certified definitions, is what turns it into trustworthy analytics.

Example

Asked for "revenue by region", a text-to-SQL tool might sum an orders table that includes refunds and test accounts unless a semantic layer tells it the approved definition.

Learn the fundamentals

Related reading

Related terms

← Back to the glossary