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

  1. The model receives the question and the database schema.
  2. It writes a SQL query.
  3. The query runs.
  4. Results are summarized or charted.

Accuracy tips

TipWhy
Clear table and column namesFewer mistakes
Business definitions"Active customer" means one thing
Read-only accessSafety
Show the SQLUsers can verify

Frequently Asked Questions

Language

Certified Secure

secure