EUVIMEDEUVIMED entdecken
Open Access · CC BY 4.0

Teaching SQL with an Agentic LLM: A Fifteen-Category Hallucination Taxonomy and Mitigation Strategy, Illustrated with Claude Sonnet 5

Paolino Di Felice

Applied Sciences · 23.11.2026 · 16 (23) · 11607

DOI: 10.3390/app162311607 ↗

Kurz gefasst

Fachartikel in der Zeitschrift Applied Sciences, online erschienen am 23.11.2026. Verfasst von Paolino Di Felice. Der Volltext ist frei zugänglich (Open Access, CC BY 4.0).

AbstractBibliografische AngabenZitierenVerwandte Studien

Abstract (Originalsprache)

Students increasingly use large language models (LLMs) to translate natural-language requests into SQL, yet these models hallucinate: they return queries, numbers, explanations or assurances unsupported by the schema, data, or request, often in a form that executes without error. This paper proposes a teaching instrument for a first course on relational databases, designed to let students experience, recognize and prevent such failures; its contribution is conceptual and illustrative. This paper proposes a teaching instrument for a first course on relational databases that lets students experience, recognize, and prevent such failures. Its core is a taxonomy of fifteen hallucination categories that is coarse enough to serve as a classroom checklist, identified through an expert-driven process (the text-to-SQL literature and 27 years of teaching experience) and illustrated on a five-table PostgreSQL schema through constructed baseline outputs that the instructor can use to open a classroom discussion of each failure. Each category is paired with a two-layer mitigation: a context pack of standing rules and seven reference files, stored once in a Claude Project, and an agentic execute–observe–correct loop in which the assistant runs rule-prescribed checks against a live database before answering. Each countermeasure is assigned to the instructor, the loop, or the user. Nine categories have a counterpart in prior text-to-SQL taxonomies, two lack a dedicated one, and four concern the answer returned to the user rather than the query, thereby escaping static benchmark-based evaluation. The workflow is free for students. The effectiveness and generalizability of the mitigation have not yet been systematically validated; frequency and classroom effectiveness are left to future work.

Zitieren

APA

Felice, P. D. (2026). Teaching SQL with an Agentic LLM: A Fifteen-Category Hallucination Taxonomy and Mitigation Strategy, Illustrated with Claude Sonnet 5. Applied Sciences, 16(23), 11607. https://doi.org/10.3390/app162311607

Vancouver

Felice PD. Teaching SQL with an Agentic LLM: A Fifteen-Category Hallucination Taxonomy and Mitigation Strategy, Illustrated with Claude Sonnet 5. Applied Sciences. 2026;16(23):11607. doi:10.3390/app162311607

BibTeX
@article{Felice2026,
  author = {Felice, Paolino Di},
  title = {Teaching SQL with an Agentic LLM: A Fifteen-Category Hallucination Taxonomy and Mitigation Strategy, Illustrated with Claude Sonnet 5},
  journal = {Applied Sciences},
  year = {2026},
  volume = {16},
  number = {23},
  pages = {11607},
  doi = {10.3390/app162311607}
}
Kostenlos starten →