G-SQL: A Schema-Aware and Rule-Guided Approach for Robust Natural Language to SQL Translation
This paper introduces G-SQL, a schema-aware and rule-guided framework for translating Natural Language Queries (NLQ) into SQL, designed to support users with limited technical expertise. G-SQL bridges the limitations of traditional rule-based and deep learning approaches by combining JSON-based schema serialization with Natural Language Processing (NLP) tools, such as GloVe and Stanford CoreNLP. The system encodes database schemas—including tables, columns, keys, and relationships—into a structured JSON format, enabling efficient and interpretable mapping between query tokens and schema elements. SQL statements are generated using a guided template-driven strategy. Evaluated across three benchmark datasets (IMDB, Yelp, MAS), For easy queries, it achieved 100% execution accuracy on all three datasets. On medium queries, G-SQL reached 95% on IMDB, 85% on Yelp, and 90% on MAS. For hard queries, the accuracy was 78% on IMDB, 65% on Yelp, and 72% on MAS. Finally, on extra-hard queries, G-SQL achieved 55% on IMDB, 45% on Yelp, and 50% on MAS., demonstrating robust performance across varying query complexities.
Authors
- Amr Mohamed AbdelAziz (ORCID: https://orcid.org/0000-0003-2571-4766)
- Taysir Hassan A. Soliman (ORCID: https://orcid.org/0000-0002-7635-4089)
- Hassan S. Shalaan
Institutions
- Beni-Suef University (EG)
- Assiut University (EG)
Publication Details
- Journal
- IEEE Access
- Published
- 2025-01-01
- DOI
- https://doi.org/10.1109/access.2025.3607879
- Primary Topic
- Semantic Web and Ontologies
- Type
- article
- Field-Weighted Citation Impact
- 0.00