Axiomatic Foundations and Algorithms for Deciding Semantic Equivalences of SQL Queries

02/06/2018
by   Shumo Chu, et al.
0

Deciding the equivalence of SQL queries is a fundamental problem in data management. As prior work has mainly focused on studying the theoretical limitations of the problem, very few implementations for checking such equivalences exist. In this paper, we present a new formalism and implementation for reasoning about the equivalences of SQL queries. Our formalism, U-semiring, extends SQL's semiring semantics with unbounded summation and duplicate elimination. U-semiring is defined using only very few axioms and can thus be easily implemented using proof assistants such as Coq for automated query reasoning. Yet, they are sufficient enough to enable us reason about sophisticated SQL queries that are evaluated over bags and sets, along with various integrity constraints. To evaluate the effectiveness of U-semiring, we have used it to formally verify 39 query rewrite rules from both classical data management research papers and real-world SQL engines, where many of them have never been proven correct before.

READ FULL TEXT

page 1

page 2

page 3

page 4

research
11/17/2020

Multi-SQL: An extensible multi-model data query language

Big data management aims to establish data hubs that support data in mul...
research
03/03/2022

PhD thesis: SQL Comprehension and Synthesis

Structured Query Language (SQL) remains the standard language used in Re...
research
01/02/2019

Verity: Blockchains to Detect Insider Attacks in DBMS

Integrity and security of the data in database systems are typically mai...
research
12/19/2019

Edit Based Grading of SQL Queries

Grading student SQL queries manually is a tedious and error-prone proces...
research
05/28/2019

One SQL to Rule Them All

Real-time data analysis and management are increasingly critical for tod...
research
06/03/2023

Evaluating Regular Path Queries in GQL and SQL/PGQ: How Far Can The Classical Algorithms Take Us?

We tackle the problem of answering regular path queries over graph datab...
research
09/06/2019

Automating Cluster Management with Weave

Modern cluster management systems like Kubernetes and Openstack grapple ...

Please sign up or login with your details

Forgot password? Click here to reset