JURNAL TEKNOLOGI DAN OPEN SOURCE
Vol. 9 No. 1 (2026): Jurnal Teknologi dan Open Source, June 2026

Rule-Based SQL Grammar Validator

Syahrul Fajar Laqsono (Universitas Bhinneka PGRI Tulungagung)
Agung Prasetya (Universitas Bhinneka PGRI Tulungagung)
Mohamad Khoirul Ansor (Universitas Bhinneka PGRI Tulungagung)



Article Info

Publish Date
06 Jun 2026

Abstract

This study addresses the growing need for reliable data access systems by focusing on the validation of SQL queries generated from natural language using a Text-to-SQL approach. The primary objective of this research is to evaluate the effectiveness of a rule-based SQL grammar validator in detecting syntactic errors and improving the overall quality of queries generated by Large Language Models (LLMs), particularly in the context of Indonesian language input. The research methodology follows a structured process, including literature review, dataset construction, system design, implementation, and performance evaluation. Two datasets were developed: one for validating the grammar checker using both valid and invalid SQL queries, and another for evaluating the Text-to-SQL system. The validator was implemented using a rule-based system with grammar defined in EBNF and executed using forward chaining inference. The results indicate that the system achieves high performance, with an accuracy of 0.909, precision of 0.857, recall of 1.000, and F1-score of 0.923. The validator successfully identifies common structural errors such as missing table references and incomplete JOIN clauses. However, some limitations remain in detecting more complex syntax patterns. Overall, the integration of the grammar checker significantly enhances the reliability of SQL query generation. In conclusion, the proposed system demonstrates strong effectiveness in syntax validation and contributes to improving the robustness of Text-to-SQL systems.

Copyrights © 2026






Journal Info

Abbrev

JTOS

Publisher

Subject

Computer Science & IT

Description

Jurnal Teknologi dan Open Source menerbitkan naskah ilmiah. yang berkaitan dengan sistem informasi, teknologi informasi dan aplikasi open source secara berkala (2 kali setahun). Jurnal ini dikelola dan diterbitkan oleh Program Studi Teknik Informatika Fakultas Teknik, Universitas Islam Kuantan ...