Easier to read with cream paper, a tint, more contrast or larger text? Choose your colours and text, once, for every page.

AI glossary

Text to SQL

Text to SQL is a language model turning a question in plain words into a database query, which is checked before anyone trusts the answer it gives.

The model is given the question and a short description of the database: its tables, their columns, how they join and what any unclear column means. It writes one SQL query, the application runs it, and the reply shows the rows beside the query so a person can see where the answer came from.

A query can run without an error and still answer a different question, by counting the same row twice, missing a filter or joining on the wrong column. So it is read against the question, run on data whose answer is known, and scored over a set of questions before a new prompt or model is used.

It runs on a read-only connection, as a single SELECT, with a row limit and a timeout, so a wrong or hostile query can read a little and change nothing.

A common mistake is to trust any query that runs. No error is not the right answer, and an empty result can be a wrong filter rather than nothing to find.

← All AI terms