What is text-to-SQL?
Text-to-SQL is the use of AI to convert a plain-language question, such as "How many urgent tickets did we close last week?", into a SQL query that runs against a database, so people can get answers from data without writing code.
How it works
- The model receives the question and the database schema.
- It writes a SQL query.
- The query runs.
- Results are summarized or charted.
Accuracy tips
| Tip | Why |
|---|---|
| Clear table and column names | Fewer mistakes |
| Business definitions | "Active customer" means one thing |
| Read-only access | Safety |
| Show the SQL | Users can verify |
