NATURAL LANGUAGE TO SQL QUERY GENERATOR
DOI:
https://doi.org/10.62643/ijerst.2026.v22.n3.4659Abstract
The Natural Language to SQL Query Generator is an intelligent system designed to allow users to retrieve information from databases by asking questions in simple natural language. Traditionally, users need knowledge of SQL syntax to interact with relational databases. This creates difficulties for non-technical users who want to access business or organizational data without writing complex SQL queries. The proposed system uses Natural Language Processing, Generative AI, Large Language Models, database metadata, and SQL generation techniques to convert natural-language questions into executable SQL queries. Users can enter questions such as “Show the total sales for each month” or “Find the employees who joined after 2024,” and the system generates an appropriate SQL query based on the connected database schema. The system first analyzes the users question and identifies important elements such as entities, conditions, filters, aggregations, sorting requirements, and requested outputs. It then retrieves relevant database schema information, including table names, column names, data types, and relationships. This context is provided to the SQL-generation engine to produce a query that matches the database structure. Before execution, the generated SQL can pass through a validation layer that checks syntax, referenced tables and columns, query type, permissions, and other safety constraints. The validated query is then executed against the database using controlled database access. The resulting data can be displayed in tables, charts, or summarized natural-language responses. Overall, the Natural Language to SQL Query Generator makes database querying more accessible by reducing the need for users to understand SQL syntax. It can be useful for business analysts, managers, students, developers, and other users who need to retrieve data quickly. Future enhancements can include support for multiple database types, conversational follow-up queries, automatic chart generation, query explanation, multilingual input, advanced schema reasoning, and enterprise access controls.
Downloads
Published
Issue
Section
License

This work is licensed under a Creative Commons Attribution-NonCommercial-NoDerivatives 4.0 International License.













