Background Text-to-Structured Query Language (SQL) systems, which allow users to query databases using natural language, have advanced significantly with the rise of Large Language Models (LLMs). While this progress has boosted accuracy, it has also introduced serious security and practical deployment challenges that existing literature has not systematically analyzed. Methodology In this article, we systematically review the existing literature to examine various approaches, identify security vulnerabilities, discuss design trade-offs, and outline future challenges. Our goal is to offer a comprehensive overview. Results Our analysis shows that modern approaches fall into two main categories: prompt engineering on proprietary models and fine-tuning open-source models. Regarding security, using the Open Worldwide Application Security Project (OWASP) Top 10 framework, we identify critical threats such as Prompt Injection (P2SQL), data poisoning to create backdoors, and inference attacks. The analysis reveals that current defense mechanisms are not effective enough against these attacks. We also highlight the strategic trade-off between the superior accuracy of proprietary models and the control, security, and cost-effectiveness of open-source models. Conclusion This survey provides a systematic analysis of security vulnerabilities in LLM-based Text-to-SQL systems, concluding that current countermeasures are inadequate. Our findings point to an urgent research direction: developing systems that are not only accurate but also robust, efficient, and fundamentally secure for reliable real-world deployment.
Bui et al. (Fri,) studied this question.