Sáenz Pérez, Fernando2025-01-142025-01-142019SÁENZ-PÉREZ F. Applying Constraint Logic Programming to SQL Semantic Analysis. Theory and Practice of Logic Programming. 2019;19(5-6):808-825. doi:10.1017/S147106841900020610.1017/S1471068419000206https://hdl.handle.net/20.500.14352/114196This paper proposes the use of Constraint Logic Programming (CLP) to model SQL queries in a dataindependent abstract layer by focusing on some semantic properties for signalling possible errors in such queries. First, we define a translation from SQL to Datalog, and from Datalog to CLP, so that solving this CLP program will give information about inconsistency, tautology, and possible simplifications. We use different constraint domains which are mapped to SQL types, and propose them to cooperate for improving accuracy. Our approach leverages a deductive system that includes SQL and Datalog, and we present an implementation in this system which is currently being tested in classroom, showing its advantages and differences with respect to other approaches, as well as some performance data.engAttribution-NonCommercial-NoDerivatives 4.0 Internationalhttp://creativecommons.org/licenses/by-nc-nd/4.0/Applying Constraint Logic Programming to SQL Semantic Analysisjournal articlehttps://doi.org/10.1017/S1471068419000206restricted access004.43Constraint Logic ProgrammingSQLSemantic CheckingDatalog Educational SystemLenguajes de programación1203.23 Lenguajes de Programación