Table of Contents
Fetching ...

Large Language Model Enhanced Text-to-SQL Generation: A Survey

Xiaohu Zhu, Qian Li, Lizhen Cui, Yongkang Liu

TL;DR

The paper surveys the emergence of large language model–driven Text-to-SQL generation, organizing approaches into prompt engineering, fine-tuning, task-training, and agent paradigms. It highlights how LLMs, combined with structured prompts, pretraining, and external tools, advance SQL generation across single- and cross-domain databases, while detailing evaluation metrics and diverse datasets. Key contributions include a taxonomy of methods, synthesis of datasets and benchmarks, and discussion of challenges such as schema linking, robustness, and efficiency. The work clarifies practical implications for deploying LLM-based Text-to-SQL systems in real-world, enterprise-like environments and identifies avenues for future research toward smarter, scalable, and generalizable SQL generation.

Abstract

Text-to-SQL translates natural language queries into Structured Query Language (SQL) commands, enabling users to interact with databases using natural language. Essentially, the text-to-SQL task is a text generation task, and its development is primarily dependent on changes in language models. Especially with the rapid development of Large Language Models (LLMs), the pattern of text-to-SQL has undergone significant changes. Existing survey work mainly focuses on rule-based and neural-based approaches, but it still lacks a survey of Text-to-SQL with LLMs. In this paper, we survey the large language model enhanced text-to-SQL generations, classifying them into prompt engineering, fine-tuning, pre-trained, and Agent groups according to training strategies. We also summarize datasets and evaluation metrics comprehensively. This survey could help people better understand the pattern, research status, and challenges of LLM-based text-to-SQL generations.

Large Language Model Enhanced Text-to-SQL Generation: A Survey

TL;DR

The paper surveys the emergence of large language model–driven Text-to-SQL generation, organizing approaches into prompt engineering, fine-tuning, task-training, and agent paradigms. It highlights how LLMs, combined with structured prompts, pretraining, and external tools, advance SQL generation across single- and cross-domain databases, while detailing evaluation metrics and diverse datasets. Key contributions include a taxonomy of methods, synthesis of datasets and benchmarks, and discussion of challenges such as schema linking, robustness, and efficiency. The work clarifies practical implications for deploying LLM-based Text-to-SQL systems in real-world, enterprise-like environments and identifies avenues for future research toward smarter, scalable, and generalizable SQL generation.

Abstract

Text-to-SQL translates natural language queries into Structured Query Language (SQL) commands, enabling users to interact with databases using natural language. Essentially, the text-to-SQL task is a text generation task, and its development is primarily dependent on changes in language models. Especially with the rapid development of Large Language Models (LLMs), the pattern of text-to-SQL has undergone significant changes. Existing survey work mainly focuses on rule-based and neural-based approaches, but it still lacks a survey of Text-to-SQL with LLMs. In this paper, we survey the large language model enhanced text-to-SQL generations, classifying them into prompt engineering, fine-tuning, pre-trained, and Agent groups according to training strategies. We also summarize datasets and evaluation metrics comprehensively. This survey could help people better understand the pattern, research status, and challenges of LLM-based text-to-SQL generations.
Paper Structure (36 sections, 5 equations, 3 figures, 2 tables)

This paper contains 36 sections, 5 equations, 3 figures, 2 tables.

Figures (3)

  • Figure 1: Flowchart of the Text-to-SQL. The flowchart illustrates the process where user questions and the database schema are first collected. These inputs are then processed through prompt engineering and fine-tuning techniques before being passed to a large language model (LLM). The LLM generates the corresponding SQL query based on the refined inputs, allowing for accurate query formulation based on natural language input.
  • Figure 2: The overview of the text-to-SQL metrics, datasets, and methods.
  • Figure 3: Prompt Engineering Methods. The figure illustrates three key prompt engineering approaches for Text-to-SQL: (a) zero-shot, where the model generates SQL without prior examples; (b) few-shot, which provides a few examples to guide query generation; (c) Reasoning, breaking down the reasoning process step-by-step for complex queries.