A Survey of Text-to-SQL in the Era of LLMs: Where are we, and where are we going?

Xinyu Liu, Shuyu Shen, Boyan Li, Peixian Ma, Runzhi Jiang +5 more
8/9/2024
115 citations
cs.DBcs.AI
survey

Official code: HKUSTDial/NL2SQL_Handbook (1,635 stars, Python, last commit 2026-04-26).

Abstract

Translating users' natural language queries (NL) into SQL queries (i.e., Text-to-SQL, a.k.a. NL2SQL) can significantly reduce barriers to accessing relational databases and support various commercial applications.

Show full abstract

The performance of Text-to-SQL has been greatly enhanced with the emergence of Large Language Models (LLMs). In this survey, we provide a comprehensive review of Text-to-SQL techniques powered by LLMs, covering its entire lifecycle from the following four aspects: (1) Model: Text-to-SQL translation techniques that tackle not only NL ambiguity and under-specification, but also properly map NL with database schema and instances; (2) Data: From the collection of training data, data synthesis due to training data scarcity, to Text-to-SQL benchmarks; (3) Evaluation: Evaluating Text-to-SQL methods from multiple angles using different metrics and granularities; and (4) Error Analysis: analyzing Text-to-SQL errors to find the root cause and guiding Text-to-SQL models to evolve. Moreover, we offer a rule of thumb for developing Text-to-SQL solutions. Finally, we discuss the research challenges and open problems of Text-to-SQL in the LLMs era. Text-to-SQL Handbook: https://github.com/HKUSTDial/NL2SQL Handbook

View on arXivView PDF

Code Implementations(1)

This is a continuously updated handbook for readers to easily track the latest Text-to-SQL techniques in the literature and provide practical guidance for researchers and practitioners.

1,63599PythonMay 21, 20247 months ago
ai4dbawesomeawesome-agentsawesome-nl2sqlawesome-text-to-sql+10 more

Similar Papers

Cite this paper

@article{liu2024survey,
  title  = {A Survey of Text-to-SQL in the Era of LLMs: Where are we, and where are we going?},
  author = {Xinyu Liu and Shuyu Shen and Boyan Li and Peixian Ma and Runzhi Jiang and Yuxin Zhang and Ju Fan and Guoliang Li and Nan Tang and Yuyu Luo},
  year   = {2024},
  eprint = {2408.05109},
  archivePrefix = {arXiv},
  url    = {http://arxiv.org/abs/2408.05109v6}
}

Add a badge to your README

Shows whether official code is linked for this paper.

Code of Paper badge
[![Code of Paper](https://codeofpaper.com/badge/2408.05109.svg)](https://codeofpaper.com/paper/2408.05109)

Discussion