Hostname: page-component-89b8bd64d-x2lbr Total loading time: 0 Render date: 2026-05-07T21:40:23.862Z Has data issue: false hasContentIssue false

Applying Constraint Logic Programming to SQL Semantic Analysis

Published online by Cambridge University Press:  20 September 2019

FERNANDO SÁENZ-PÉREZ*
Affiliation:
Complutense University of Madrid, 28040 Madrid, Spain (e-mail: fernan@sip.ucm.es)

Abstract

This paper proposes the use of Constraint Logic Programming (CLP) to model SQL queries in a data-independent 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.

Information

Type
Original Article
Copyright
© Cambridge University Press 2019 

Access options

Get access to the full version of this content by using one of the access options below. (Log in options will check for institutional or personal access. Content may require purchase if you do not have access.)

Article purchase

Temporarily unavailable