Glossary

Text-to-SQL

Technology that translates a plain-language question directly into a runnable SQL query against a database.

Also called: text2sql, natural language to SQL

Text-to-SQL is technology, typically built on a large language model, that converts a plain-language question into a SQL query that can run directly against a database or warehouse. It is the mechanism that often powers natural language query features in analytics tools, turning "how many new customers did we get last month" into an executable query against the relevant tables.

Accuracy depends heavily on how well the system understands the underlying schema: table and column names, relationships between tables, and business definitions of terms like "customer" or "active." Systems that work directly against raw data warehouse tables without that context tend to guess at joins and definitions; more reliable implementations query through a governed semantic layer that already encodes the correct joins, metric definitions, and filters.

Text-to-SQL matters because it removes SQL literacy as a barrier to exploring data, extending augmented analytics and self-service tools to a wider audience. The central pitfall is silent misinterpretation: a generated query can run without error and return a real number that answers a subtly different question than the one asked—picking the wrong date range, the wrong join, or an ambiguous metric definition—so results should be reviewed against the generated SQL, not accepted purely on the strength of a fluent-sounding answer.

Last reviewed September 19, 2026

In the index now

Related terms

Related tools

Related guides