# Text-to-SQL · Glossary
Using a language model to translate a question in plain English into a database query, run it and return the result.
[Glossary](/glossary) · Agentic systems and generative AI

# Text-to-SQL

     Using a language model to translate a question in plain English into a database query, run it and return the result. It lets people who do not write SQL ask questions of structured data directly.

## Why it matters

     Text-to-SQL promises faster access to data, but a query that runs is not necessarily a query that is right. Ambiguous business terms, complex joins and inconsistent metric definitions all lead to plausible but incorrect answers.

     Reliable implementations constrain the model to a governed semantic layer or curated views, show the query and definitions used, respect row-level permissions and are evaluated against a set of known questions.

## In practice

     For example, a UK multi-site retailer might let area managers ask ‘which stores missed their weekly sales target’ through a text-to-SQL assistant that queries only certified sales views, displays the metric definition and logs every generated query.

## Where Rodan fits

     Rodan connects natural-language analytics to governed metrics in [Analytics and Intelligence](https://rodan.io/what-we-build/analytics-intelligence) work. See also [what is structured data injection and when should you use it instead of RAG](https://rodan.io/insights/what-is-structured-data-injection-and-when-should-you-use-it-instead-of-rag).

## Related terms

- [Semantic layer](/glossary#semantic-layer)

- [Self-service analytics](/glossary/self-service-analytics)

- [Large language model](/glossary#large-language-model)

- [Data warehouse](/glossary/data-warehouse)

- [Role-based access control (RBAC)](/glossary/role-based-access-control)
HTML: https://rodan.io/glossary/text-to-sql
