EUVIMEDEUVIMED entdecken
Open Access · CC BY 4.0

Schema-Guided Prompt Strategies for Text-to-SQL over Relational Databases Using Local LLMs

Nurjayanti Nurjayanti, Adiwijaya Adiwijaya, Ade Romadhony, Alfian Akbar Gozali

Jurnal RESTI (Rekayasa Sistem dan Teknologi Informasi) · 30.07.2026 · 10 (4) · 949-957

DOI: 10.29207/resti.v10i4.6966 ↗

Kurz gefasst

Fachartikel in der Zeitschrift Jurnal RESTI (Rekayasa Sistem dan Teknologi Informasi), online erschienen am 30.07.2026. Verfasst von Nurjayanti Nurjayanti und 3 weiteren Autor:innen. Der Volltext ist frei zugänglich (Open Access, CC BY 4.0).

AbstractBibliografische AngabenZitierenVerwandte Studien

Abstract (Originalsprache)

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.

Zitieren

APA

Nurjayanti, N., Adiwijaya, A., Romadhony, A., & Gozali, A. A. (2026). Schema-Guided Prompt Strategies for Text-to-SQL over Relational Databases Using Local LLMs. Jurnal RESTI (Rekayasa Sistem dan Teknologi Informasi), 10(4), 949-957. https://doi.org/10.29207/resti.v10i4.6966

Vancouver

Nurjayanti N, Adiwijaya A, Romadhony A, Gozali AA. Schema-Guided Prompt Strategies for Text-to-SQL over Relational Databases Using Local LLMs. Jurnal RESTI (Rekayasa Sistem dan Teknologi Informasi). 2026;10(4):949-957. doi:10.29207/resti.v10i4.6966

BibTeX
@article{Nurjayanti2026,
  author = {Nurjayanti, Nurjayanti and Adiwijaya, Adiwijaya and Romadhony, Ade and Gozali, Alfian Akbar},
  title = {Schema-Guided Prompt Strategies for Text-to-SQL over Relational Databases Using Local LLMs},
  journal = {Jurnal RESTI (Rekayasa Sistem dan Teknologi Informasi)},
  year = {2026},
  volume = {10},
  number = {4},
  pages = {949--957},
  doi = {10.29207/resti.v10i4.6966}
}
Kostenlos starten →