# What is text-to-SQL? Definition and Examples | Silicon

URL: https://meetsilicon.com/glossary/text-to-sql/

> Text-to-SQL is the use of AI to turn a plain-English question into a SQL query that runs against a database.

On raw tables, text-to-SQL has to guess at joins and column meanings, which is where wrong answers come from. Grounding it in a semantic layer means the model chooses from defined metrics instead of writing business logic from scratch.
## Why raw text-to-SQL gets numbers wrong
A model writing SQL against raw tables has to decide which table holds revenue, whether to exclude refunds, how tables join and which date to filter on. Each choice can be reasonable and still differ from how the finance team calculates the number, so the answer looks right and does not match the board report.
## What makes it more reliable
Grounding the model in defined metrics and documented joins, showing the generated query with every answer so people can check it, and running queries with the asker's permissions. Teams also review frequent questions and save the good answers as verified ones.
## How Silicon handles it
Silicon's AI analyst answers from the metrics in your semantic layer, shows the query and definitions behind each answer, and runs as the person asking so permissions apply.
FAQ
## Text-to-SQL questions
### Is text-to-SQL accurate enough for business reporting? +
On raw tables it is often unreliable for business metrics. Grounded in a semantic layer, with the query shown for checking, it is used for day-to-day questions at many companies.
### Does text-to-SQL replace data analysts? +
It takes over routine lookups. Analysts still define the metrics it relies on and handle questions that need judgment.
## Related
- Semantic layer ->
- How AI analytics works with dbt metrics ->
## Tell us where your data lives today.
Book 30 minutes with the founder. Tell us where your data is today, and see Silicon running on sample data.
Talk to Sujay
30-minute call with the founder
