Development of a Business Data Question-Answering System Using Natural Language Based on Generative Artificial Intelligence

Main Article Content

Noppakun Nantasanee
Sudasawan Ngammongkolwong

Abstract

Accessing business information for rapid decision-making today remains significantly hampered by specialized SQL language skills and the problem of hallucination in large-scale language models when working with complex database structures. This research aims to develop a natural language-to-database (NL2SQL) business information querying system and evaluate its technical performance by applying Retrieval-Augmented Generation (RAG) techniques combined with schema injection through the gpt-oss-120b generative AI model on a Groq LPU. The research process involved pilot testing using a standard Spider 1.0 dataset in the department store domain, consisting of 25 questions covering difficulty levels from easy to difficult. The results showed that the developed system performed significantly better than the basic query input method (zero-shot baseline), with an execution accuracy of up to 96.00% and an exact matching (EM) accuracy of 32.00%. Processing time efficiency was also assessed. The system has an average response time of only 0.73 seconds, which meets the human-computer interaction (HCI) benchmark of no more than 3 seconds. The results of this research confirm that integrating database architecture with generative artificial intelligence technology can effectively solve data hallucination problems and reduce communication latency, enabling general users and executives to access insightful data to support business decision-making accurately and quickly at a real-world level.

Article Details

How to Cite
[1]
N. Nantasanee and S. Ngammongkolwong, “Development of a Business Data Question-Answering System Using Natural Language Based on Generative Artificial Intelligence”, RMUTP Sci J, vol. 20, no. 1, pp. 80–93, Jun. 2026.
Section
บทความวิจัย (Research Articles)

References

N. Rajkumar, R. Li, and D. Bahdanau, “Evaluating the text-to-SQL capabilities of large language models,” arXiv Computation and Language, arXiv:2204.00498, 2022.

F. Li and H. V. Jagadish, “Constructing an interactive natural language interface for relational databases,” in Proceedings of the VLDB Endowment, vol. 8, no. 1, pp. 73-84, 2014.

T. B. Brown et al., “Language models are few-shot learners,” arXiv Computation and Language, arXiv:2005.14165, 2020.

A. Vaswani, N. Shazeer, N. Parmar, J. Uszkoreit, L. Jones, A. N. Gomez, Ł. Kaiser, and I. Polosukhin, "Attention is all you need," Advances in Neural Information Processing Systems, vol. 30, 2017.

X. Liu et al., "A survey of NL2SQL with large language models: Where are we, and where are we going?," arXiv preprint arXiv:2408.05109, 2024.

Z. Hong, Z. Yuan, Q. Zhang, H. Chen, J. Dong, F. Huang, and H. Huang, “Next-generation database interfaces: A survey of LLM-based text-to-SQL,” IEEE Transactions on Knowledge and Data Engineering, vol. 37, no. 12, pp. 7328-7345, 2025.

T. Gladkykh and K. Kirykov, “Datrics Text2SQL: A framework for natural language to SQL query generation,” arXiv Databases, arXiv:2506.12234, 2025.

A. Chen et al., "Text-to-SQL for enterprise data analytics," arXiv preprint arXiv:2507.14372, 2025.

P. Khampirapang, “Automatic SQL Database Query Generation Using ChatGPT API,” M.S. thesis, Dept. Comput. Eng., Dhurakij Pundit Univ., Bangkok, Thailand, 2024.

T. Yu et al., “Spider: A large-scale human-labeled dataset for complex and cross-domain semantic parsing and text-to-SQL task,” arXiv Computation and Language, arXiv:1809.08887, 2018.

M. A. Hertzog, “Considerations in determining sample size for pilot studies,” Research in Nursing & Health, vol. 31, no. 2, pp. 180–191, 2008.

J. Li et al., “Can LLM already serve as a database interface? a big bench for large-scale database grounded text-to-sqls,” arXiv Computation and Language, arXiv:2305.03111, 2023.

V. Liu and L. B. Chilton, “Design guidelines for prompt engineering text-to-image generative models,” in Proceedings of the 2022 CHI Conference on Human Factors in Computing Systems, 2022, pp. 1–14.

P. Lewis and E. Perez, “Retrieval-augmented generation for knowledge-intensive NLP tasks,” in Proceedings of 34th Conference on Neural Information Processing Systems (NeurIPS 2020), Vancouver, Canada, 2020.

R. Zhong, T. Yu, and D. Klein, “Semantic evaluation for text-to-SQL with distilled test suites,” in Proceedings of the 2020 Conference on Empirical Methods in Natural Language Processing (EMNLP), 2020, pp. 396–411.

J. Nielsen, Usability Engineering, San Francisco, CA: Morgan Kaufmann, 1994.

K. T. Pham, T. H. Nguyen, J. Jo, Q. V. H. Nguyen, and T. T. Nguyen, “Multilingual text-to-SQL: Benchmarking the limits of language models with collaborative language agents,” arXiv Computation and Language, arXiv:2509.24405, 2025.