liveBook · Manning

Text-to-SQL

Text-to-SQL is the technique of translating natural-language requests into SQL queries for retrieving or manipulating data in a database.

How 2 Manning books explain it

Data Analysis with LLMs

Text-to-SQL translation is the task of translating questions expressed in natural language into SQL queries.

How it is used
Turns natural-language questions about tabular data into SQL queries for a database to execute.
How deep it goes
Works through prompt construction and manual query testing, while deferring automatic execution and support for changing database schemas.
Examples
Uses survey results, product reviews, and game-sales questions, including a generated query that counts rows in a games table.
What you can do after
Build it from scratch as a Python prompt-based translator, then run and inspect its generated queries using SQLite.

Read how Data Analysis with LLMs explains text-to-SQL →

AI Agents and Applications

Text-to-SQL is a technique that converts natural-language questions into executable SQL queries.

How it is used
Enables natural-language access to structured facts stored in relational databases.
How deep it goes
Explains schema-aware prompting and execution, but stops short of database-specific implementation details.
Examples
Uses a state table with CREATE TABLE metadata, sample rows, and questions such as unit sales or resort information.
What you can do after
Apply via an LLM application to generate and execute SQL against structured relational data.

Read how AI Agents and Applications explains text-to-SQL →

Related concepts

These guides are generated from the text of Manning books by Manning's knowledge graph and link to the sections they draw on. The full books are available on liveBook and at manning.com.