Datenbank-Spektrum Computer science

Experience Report: Hey LLM, Generate SQL!

Florian Heinz, Johannes Schildgen
Springer Nature · 2025-07-01 · DOI 10.1007/s13222-025-00512-w

Abstract

Abstract Large Language Models have advanced to a resourceful tool with many applications. One particularly interesting use case is the LLM-aided generation of ad-hoc database queries and the possibility of subsequent processing of the results in a way suiting the users intents. In this article, practical ways and experiences are described on how to effectively use LLMs to map a natural-language user query to an SQL query conforming to a specific database schema and post-processing the results of this query in order to, for example, create an appealing visualization. Best results are achieved under favorable circumstances, as, for example, a clean and meaningful named database schema.

Read at publisher →