Comparison of AI agents for creating SQL queries

Main Article Content

Julia Sierpień

jula.s1202@gmail.com

Maria Skublewska-Paszkowska

maria.paszkowska@pollub.pl

https://orcid.org/0000-0002-0760-7126

Abstract

Large language models have been increasingly applied for Text-to-SQL tasks recently, due to the fact that generating correct SQL queries is the most important factor. This study presents a comparison of AI agents based on open-source and closed-source large language models for generating SQL queries. GPT-4o, Claude 3.7 Sonnet, and LLaMA 3 8B were evaluated using two widely known datasets: Spider and WikiSQL. The chosen architectures were compared using Exact Match, F1-score, BERTScore, Execution Accuracy and processing time. Obtained results show that all agents perform well on simple queries, while agents based on closed-source models achieve better performance on complex SQL generation tasks.

Keywords:

LLMs, Text-to-SQL, AI agents

Sustainable Development Goal (SDG)

  • Industry, Innovation, Technology and Infrastructure

References

Article Details

Sierpień, J., & Skublewska-Paszkowska, M. (2026). Comparison of AI agents for creating SQL queries. Journal of Computer Sciences Institute, 40, 283-288. https://doi.org/10.35784/jcsi.9844