International Peer-Reviewed JournalOpen AccessISSN 2456-8880
irejournals@gmail.com+91-7433024337

Home / Current Issue / Paper 1716470

1716470 Vol 9 · Issue 10 Download Paper

Natural Language Querying of DUCKDB using LLM

Poojitha K D Chandana M Pallegar G K Harshitha Rakshitha B M Padmapriya H N

Subject area: Science,Engineering and Technology  ·  Area of research: Natural Language Database Querying

DOI: https://doi.org/10.64388/IREV9I10-1716470

Abstract

Many users work with CSV files to store data, but analyzing this data usually requires knowledge of SQL, which can be difficult for non-technical users. To overcome this problem, this project presents a web-based application that allows users to interact with their data using simple English queries instead of writing SQL commands. The system converts natural language input into SQL queries, making data analysis faster and easier without requiring any programming skills. The proposed system runs completely offline and is developed using the Flask web framework along with a locally hosted pre-trained Large Language Model. This approach ensures data privacy and avoids dependency on cloud-based services. When a CSV file is uploaded, it is processed using Pandas to clean column names, identify data types, and dynamically generate a relational structure inside DuckDB, an in-memory analytical database. The user’s query is combined with the dataset schema and processed by the language model to generate accurate SQL statements. These queries are validated to prevent unsafe operations and are then executed on the dataset, with results returned in a structured JSON format. The application provides a simple and interactive user interface built using HTML, CSS, and JavaScript, supporting drag-and-drop file uploads, data preview, and real-time query responses. This project demonstrates an efficient and secure solution for querying structured data using natural language, making it useful for academic, business, and inventory-related datasets. Future improvements may include support for multiple datasets, graphical data visualization, and enhanced model optimization for handling more complex queries.

How to cite this paper

Poojitha K D, Chandana M Pallegar, G K Harshitha, Rakshitha B M, Padmapriya H N "Natural Language Querying of DUCKDB using LLM" Iconic Research And Engineering Journals Volume 9 Issue 10 2026 Page 2596-2622 https://doi.org/10.64388/IREV9I10-1716470
Poojitha K D, Chandana M Pallegar, G K Harshitha, Rakshitha B M, Padmapriya H N "Natural Language Querying of DUCKDB using LLM" Iconic Research And Engineering Journals, vol. 9, no. 10, Apr. 2026, doi: https://doi.org/10.64388/IREV9I10-1716470
Poojitha K D, Chandana M Pallegar, G K Harshitha, Rakshitha B M, Padmapriya H N (2026). Natural Language Querying of DUCKDB using LLM. Iconic Research And Engineering Journals, 9(10). doi: https://doi.org/10.64388/IREV9I10-1716470
Poojitha K D, Chandana M Pallegar, G K Harshitha, Rakshitha B M, Padmapriya H N "Natural Language Querying of DUCKDB using LLM" Iconic Research And Engineering Journals, vol. 9, no. 10, Apr. 2026. Crossref, https://doi.org/10.64388/IREV9I10-1716470
@article{1716470,
      author = {Poojitha K D, Chandana M Pallegar, G K Harshitha, Rakshitha B M, Padmapriya H N},
      title = {Natural Language Querying of DUCKDB using LLM},
      journal = {Iconic Research And Engineering Journals},
      year = {2026},
      volume = {9},
      number = {10},
      pages = {2596-2622},
      issn = {2456-8880},
      url = {https://www.irejournals.com/formatedpaper/1716470.pdf},
      abstract = {Many users work with CSV files to store data, but analyzing this data usually requires knowledge of SQL, which can be difficult for non-technical users. To overcome this problem, this project presents a web-based application that allows users to interact with their data using simple English queries instead of writing SQL commands. The system converts natural language input into SQL queries, making data analysis faster and easier without requiring any programming skills. The proposed system runs completely offline and is developed using the Flask web framework along with a locally hosted pre-trained Large Language Model. This approach ensures data privacy and avoids dependency on cloud-based services. When a CSV file is uploaded, it is processed using Pandas to clean column names, identify data types, and dynamically generate a relational structure inside DuckDB, an in-memory analytical database. The user’s query is combined with the dataset schema and processed by the language model to generate accurate SQL statements. These queries are validated to prevent unsafe operations and are then executed on the dataset, with results returned in a structured JSON format. The application provides a simple and interactive user interface built using HTML, CSS, and JavaScript, supporting drag-and-drop file uploads, data preview, and real-time query responses. This project demonstrates an efficient and secure solution for querying structured data using natural language, making it useful for academic, business, and inventory-related datasets. Future improvements may include support for multiple datasets, graphical data visualization, and enhanced model optimization for handling more complex queries.},
      month = {April},
      doi = {https://doi.org/10.64388/IREV9I10-1716470}
  }