GRENZE International Journal of Engineering and Technology
Vol. 12
(2026), Issue 1
Text-to-SQL Generation using T5-Large with Schema Aware Encoding
Authors
Akshay Poojaryr, Varsha Sajjanavar, Darshan Lingraddi, Shreeporna Petkar, Uday Kulkarni
Abstract
The task of translating natural language queries into executable SQL statements— commonly referred to as Text-to-SQL—is a critical step toward enabling intuitive and userfriendly access to relational databases for non-technical users. In this work, we present a schema-aware sequence-to-sequence approach utilizing the T5-large language model to automatically generate SQL queries from natural language questions. Our method enhances the model’s contextual understanding by incorporating structured schema information—such as table and column names—directly into the input sequence, enabling better alignment between user intent and database structure. We fine-tune the T5 model on benchmark datasets including Spider, which contain complex, cross-domain queries with corresponding database schemas. Experimental results demonstrate that our schemaaware formulation leads to improved syntactic and execution accuracy, while also enhancing the model’s generalization to unseen database schemas. Specifically, we achieve an Exact Match Accuracy of 70% on a set of 10 evaluation queries, where 7 queries were generated exactly as the ground truth, and 3 exhibited minor deviations that, while semantically correct, were marked incorrect under strict matching criteria. This approach highlights the effectiveness of leveraging pre-trained language models with structured context for robust and accurate SQL query generation.
Pages:
1200 - 1207