SQLCert: Coq mechanisation of SQL's compilation: Formally reconciling SQL and (relational) algebra

Abstract : SQL is the standard language for manipulating data stored in relational database systems. In theory, SQL is based on the relational data model. However, there is an important mismatch between the theoretical foundations and the corresponding standard specification, as SQL history spread over decades. Briefly, the disparities concern the treatment of relations: finite sets in theory, finite bags in practice, the treatment of attributes and the chosen corresponding algebra used to compile queries. We propose SQLCert, a Coq mechanisation of three, among four, central steps of SQL's compilation chain: the syntactic analysis, the semantics analysis and the logical optimisation steps. To this purpose, we propose SQLCoq a Gallina grammar and associated Coq-mechanised semantics accounting for the native fragment of SQL described in the ISO/IEC 2006 Final Committee draft. As SQL compilers' logical optimisation is based on algebraic rewritings, we also define ExtAlg a Coq-mechanised extended bag-set-algebra, deeply relate SQLCoq to it and prove, using Coq, most of the commonly used in practice (SQL's queries) rewritings, yielding strong guarantees for the optimiser. Doing so, we thus formally reconcile SQL and its theoretical algebraic counterpart and provide the first, to our knowledge, executable mechanisation proposal of a (realistic fragment of) SQL compiler.
Liste complète des métadonnées

https://hal.archives-ouvertes.fr/hal-01487062
Contributor : Evelyne Contejean <>
Submitted on : Friday, March 10, 2017 - 6:24:49 PM
Last modification on : Tuesday, April 24, 2018 - 1:53:59 PM
Document(s) archivé(s) le : Sunday, June 11, 2017 - 5:18:16 PM

File

main.pdf
Files produced by the author(s)

Licence


Copyright

Identifiers

  • HAL Id : hal-01487062, version 1

Citation

Véronique Benzaken, Evelyne Contejean. SQLCert: Coq mechanisation of SQL's compilation: Formally reconciling SQL and (relational) algebra. 2016. ⟨hal-01487062⟩

Share

Metrics

Record views

362

Files downloads

329