Axiomatic Foundations and Algorithms for Deciding Semantic Equivalences of SQL Queries
Not on the map. Why?
Abstract (arXiv)
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.
Key facts. Cited by 11 papers in the map (data through 7 Oct 2026). First posted on arXiv 6 Feb 2018.
Builds on
No reference list yet.
Built on by
Citing papers per year: 2023: 1; 2024: 4; 2025: 4; 2026: 2.
11 papers.
- 2023LLM-SQL-Solver: Can LLMs Determine SQL Equivalence?cited by 10
- 2025LeanTree: Accelerating White-Box Proof Search with Factorized States in Lean 4cited by 3
- 2025SpotIt: Evaluating Text-to-SQL Evaluation with Formal Verificationcited by 3
- 2024Can the Rookies Cut the Tough Cookie? Exploring the Use of LLMs for SQL Equivalence Checkingcited by 2
- 2024GEqO: ML-Accelerated Semantic Equivalence Detectioncited by 1
- 2024FuncEvalGMN: Evaluating Functional Correctness of SQL via Graph Matching Networkcited by 1
- 2026SpotIt+: Verification-based Text-to-SQL Evaluation with Database Constraintscited by 1
- 2026SQLStructEval: Structural Evaluation of LLM Text-to-SQL Generationcited by 1
- 2024An Automated SQL Query Grading System Using An Attention-Based Convolutional Neural Networkcited by 0
- 2025Polygon: Symbolic Reasoning for SQL using Conflict-Driven Under-Approximation Searchcited by 0
- 2025AutoIndexer: A Reinforcement Learning-Enhanced Index Advisor Towards Scaling Workloadscited by 0
- 2026SQLStructEval: Structural Evaluation of LLM Text-to-SQL Generation8 Apr 2026
- 2026SpotIt+: Verification-based Text-to-SQL Evaluation with Database Constraints4 Mar 2026
- 2025SpotIt: Evaluating Text-to-SQL Evaluation with Formal Verification30 Oct 2025
- 2025AutoIndexer: A Reinforcement Learning-Enhanced Index Advisor Towards Scaling Workloads30 Jul 2025
- 2025LeanTree: Accelerating White-Box Proof Search with Factorized States in Lean 419 Jul 2025
- 2025Polygon: Symbolic Reasoning for SQL using Conflict-Driven Under-Approximation Search9 Apr 2025
- 2024Can the Rookies Cut the Tough Cookie? Exploring the Use of LLMs for SQL Equivalence Checking7 Dec 2024
- 2024FuncEvalGMN: Evaluating Functional Correctness of SQL via Graph Matching Network9 Jul 2024
- 2024An Automated SQL Query Grading System Using An Attention-Based Convolutional Neural Network22 Jun 2024
- 2024GEqO: ML-Accelerated Semantic Equivalence Detection2 Jan 2024
- 2023LLM-SQL-Solver: Can LLMs Determine SQL Equivalence?16 Dec 2023