Jul 2026· Jurnal RESTI (Rekayasa Sistem dan Teknologi Informasi)· 0 citations
TL;DR
It is suggested that structured prompt engineering provides a practical alternative to model fine-tuning for locally deployed LLMs, offering an effective balance between SQL generation accuracy, computational efficiency, and data privacy.
Abstract
Text-to-SQL systems translate natural language questions into executable SQL queries, allowing users without SQL expertise to access structured data stored in relational databases. Although Large Language Models (LLMs) have substantially improved SQL generation capabilities, many state-of-the-art Text-to-SQL approaches continue to rely on cloud-based models with high computational requirements. Such dependence limits their deployment in environments with limited computing resources. This study addresses this limitation by proposing schema-guided prompting strategies for Text-to-SQL generation using local LLMs. A chat-based application was developed using the Django Web Framework, while model inference was performed through the Ollama platform to enable the deployment of local LLMs. The proposed framework incorporates database schema information, including table structures and column attributes, into structured prompts to improve the alignment between natural language questions and SQL generation. Experiment results across multiple databases demonstrate that schema-guided prompting significantly improves Text-to-SQL performance. The highest accuracy was achieved by LLaMA 3 (8B) with objective-aware prompting, reaching an Exact Matching (EM) accuracy of 71.96%. These findings suggest that structured prompt engineering provides a practical alternative to model fine-tuning for locally deployed LLMs, offering an effective balance between SQL generation accuracy, computational efficiency, and data privacy. Future work will investigate fine-tuning strategies, example selection methods, and cross-domain evaluation to enhance SQL generation.
Experimental results demonstrate that GPS-Relational constructs executable reference SQL across existing benchmark and complex generated queries, and that LLM execution accuracy degrades significantly as nesting depth increases up to 15 levels.
Goli Vaisi, P. Sheu· International Journal of Sem...· 0 citations
SPOC-SQL is proposed, which decomposes Text-to-SQL into four sequential subtasks following standard SQL execution logic and designs stage-specific optimization strategies for the model to learn key decisions, with the objective of enhancing structured decision-making during query construction.
Yingnan Chen, Chun Ding, Tianshi Xu et al.· 0 citations
Large language models (LLMs) have advanced Text-to-SQL by enabling natural language interfaces to databases without task-specific fine-tuning. However, existing LLM-based systems remain unreliable, often generating SQL queries that are invalid under the database schema, referencing non-existent tables, attributes, functions, or values. Such errors persist because interactions with the database management system (DBMS) are typically limited to error messages, leaving it in a largely passive role during query refinement. This paper proposes SafeQL,
a search-based refinement paradigm that redefines the role of the DBMS as an active guide in the refinement process.
Instead of regenerating entire queries after execution failure, SafeQL interprets DBMS feedback to incrementally repair only the erroneous components. Each refinement step is formulated as a guided search within a
safe query space
, where candidate queries are progressively validated through DBMS execution, thereby converging to an executable query and preventing repeated regeneration of errors. Experiments on the Bird and Spider benchmarks show that SafeQL significantly improves execution accuracy and efficiency compared to regeneration-based methods.
Geonho Lee, Min-Soo Kim· Proceedings of the VLDB Endo...· 0 citations
Given a database S and a natural language question Q, text-to-SQL systems aim to generate an SQL query that correctly answers Q when executed against S. Currently, popular text-to-SQL benchmarks mostly assume unrestricted access to S; in practice, however, user access is often restricted, e.g., through role-based access control (RBAC) policies. This leads to a potential disconnect between benchmarking results and real-world performance: an LLM with high benchmark scores might perform poorly in an access-controlled environment, by frequently violating RBAC, or rejecting a query q that could be answered with only permitted data in S. Motivated by this, we present a comprehensive text-to-SQL benchmarking framework with realistic RBAC constraints, which features an LLM-assisted workflow that augments existing text-to-SQL benchmarks with plausible user roles and access policies. To do so, we formulate the problem of role synthesis as a structured reasoning process over the database schema, in which the LLM first infers the application context from the schema, and then derives role responsibilities and access scopes consistent with this context. This process is audited by human-in-the-loop quality control, in which domain experts perform metric-guided screening on the generated roles. Besides the augmented dataset, the proposed framework also contains evaluation metrics that identify RBAC-specific failure modes, and disentangle SQL utility from access-control compliance. We apply the proposed framework to several widely-used benchmarks, and conduct a systematic empirical study of state-of-the-art text-to-SQL systems. The results show that many solutions (especially open-weight LLMs) with high benchmarking scores under an unrestricted setting suffer sharp performance degradation once access constraints are in place, due to frequent RBAC violations.
Yang Fei, Yangfan Jiang, Yin Yang et al.· 0 citations
SQuaD-SQL (Small-Qualified and Distilled for SQL), a novel approach that empowers small language models to approach the performance of LLMs on the Text-to-SQL task while significantly improving efficiency through knowledge distillation and synthetic data generation, is introduced.
Wangyu Wu, Xiaojian Lin, Rong Fu et al.· 0 citations
This work proposes MDB-Link, a hierarchical schema-linking framework that retrieves question-relevant columns from a global index, aggregates retrieval evidence to shortlist databases, and uses a budget-aware large language model (LLM) for database reranking, table selection, and column grounding.
Beiyu Xu, Zhenyu Wu, Jiaoyan Chen et al.· 0 citations