SQLCert: Coq mechanisation of SQL’s compilation: Formally reconciling SQL and (relational) algebra. 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.
References in zbMATH (referenced in 1 article )
Showing result 1 of 1.
- Benzaken, V.; Contejean, É.; Keller, Ch.; Martins, E.: A Coq formalisation of SQL’s execution engines (2018)