SQL learners often require targeted practice to avoid recurring syntactic and semantic errors. However, generating personalized SQL exercises remains a challenging and time-consuming task. While Large Language Models (LLMs) enable scalable automatic content generation, they provide limited guarantees on the correctness and consistency of the produced exercises. This paper presents a personalized exercise generation component for LensQL, a framework for SQL learning centered on student error analysis. The proposed component automatically generates SQL assignments and reference solutions by combining LLM-based generation with a validation layer enforcing structural and pedagogical constraints at both schema and query levels.
Personalized SQL Exercise Generation with Large Language Models and Constraint-Based Validation
Davide Ponzini;Elisa Calza;Barbara Catania;Giovanna Guerrini
2027-01-01
Abstract
SQL learners often require targeted practice to avoid recurring syntactic and semantic errors. However, generating personalized SQL exercises remains a challenging and time-consuming task. While Large Language Models (LLMs) enable scalable automatic content generation, they provide limited guarantees on the correctness and consistency of the produced exercises. This paper presents a personalized exercise generation component for LensQL, a framework for SQL learning centered on student error analysis. The proposed component automatically generates SQL assignments and reference solutions by combining LLM-based generation with a validation layer enforcing structural and pedagogical constraints at both schema and query levels.I documenti in IRIS sono protetti da copyright e tutti i diritti sono riservati, salvo diversa indicazione.



