A Survey of Large Language Model-Based Generative AI for Text-to-SQL: Benchmarks, Applications, Use Cases, and Challenges
Aditi Singh, Akash Shetty, Abul Ehtesham, Saket Kumar, Tala Talaei Khoei
TL;DR
The paper addresses translating natural language queries into $SQL$ over relational databases, surveying the evolution from rule-based systems to LLM-based text-to-SQL, including core components, benchmark datasets (e.g., Spider, WikiSQL, CoSQL), and representative models. It reviews model progress from Seq2SQL and SQLNet to transformer-based architectures (e.g., RAT-SQL, X-SQL) and domain-specific variants (MedT5SQL, EDU-T5, EHRSQL), assessed via metrics such as Exact Set Match and Execution accuracy. It highlights applications across healthcare, education, finance, and business intelligence, while identifying persistent challenges like domain generalization, ambiguity handling, NoSQL support, and query efficiency, proposing future directions including universal multi-domain models, interactive disambiguation, and external knowledge integration. The findings provide a roadmap for researchers and practitioners to advance robust, scalable, and interpretable text-to-SQL systems with broader real-world impact.
Abstract
Text-to-SQL systems facilitate smooth interaction with databases by translating natural language queries into Structured Query Language (SQL), bridging the gap between non-technical users and complex database management systems. This survey provides a comprehensive overview of the evolution of AI-driven text-to-SQL systems, highlighting their foundational components, advancements in large language model (LLM) architectures, and the critical role of datasets such as Spider, WikiSQL, and CoSQL in driving progress. We examine the applications of text-to-SQL in domains like healthcare, education, and finance, emphasizing their transformative potential for improving data accessibility. Additionally, we analyze persistent challenges, including domain generalization, query optimization, support for multi-turn conversational interactions, and the limited availability of datasets tailored for NoSQL databases and dynamic real-world scenarios. To address these challenges, we outline future research directions, such as extending text-to-SQL capabilities to support NoSQL databases, designing datasets for dynamic multi-turn interactions, and optimizing systems for real-world scalability and robustness. By surveying current advancements and identifying key gaps, this paper aims to guide the next generation of research and applications in LLM-based text-to-SQL systems.
