VeriEQL: Bounded Equivalence Verification for Complex SQL Queries with Integrity Constraints
Yang He, Pinhan Zhao, Xinyu Wang, Yuepeng Wang
Abstract
The task of SQL query equivalence checking is important in various real-world applications (including query rewriting and automated grading) that involve complex queries with integrity constraints; yet, state-of-the-art techniques are very limited in their capability of reasoning about complex features (e.g., those that involve sorting, case statement, rich integrity constraints, etc.) in real-life queries. To the best of our knowledge, we propose the first SMT-based approach and its implementation, VeriEQL, capable of proving and disproving bounded equivalence of complex SQL queries. VeriEQL is based on a new logical encoding that models query semantics over symbolic tuples using the theory of integers with uninterpreted functions. It is simple yet highly practical -- our comprehensive evaluation on over 20,000 benchmarks shows that VeriEQL outperforms all state-of-the-art techniques by more than one order of magnitude in terms of the number of benchmarks that can be proved or disproved. VeriEQL can also generate counterexamples that facilitate many downstream tasks (such as finding serious bugs in systems like MySQL and Apache Calcite).
Ask about this paper
Your agent reads all of it.
Lune indexed this paper to the last equation, along with the top-tier papers that cite it. Ask a question and the answer quotes them.
Your agent calls
Luneget_paper_fulltext
Free to start. No credit card required.
Terminal
Install the CLIlune papers fulltext 7daa3a30-4b12-4b67-a04e-3e6b738c3970Cited by top-tier papers11
- Automated Validating and Fixing of Text-to-SQL Translation with Execution ConsistencyYicun Yang, Zhaoguo Wang, Yu Xia, Zhuoran Wei et al.SIGMOD 2025 · 7 citations
- SpotIt: Evaluating Text-to-SQL Evaluation with Formal VerificationRocky Klopfenstein, Yang He, Andrew Tremante, Yuepeng Wang et al.ICLR 2026 · 6 citations
- Graphiti: Bridging Graph and Relational Database QueriesYang He, Ruijie Fang, Isil Dillig, Yuepeng WangPLDI 2025 · 3 citations
- Checking Observational Correctness of Database SystemsLauren Pick, Amanda Xu, Ankush Desai, Sanjit A. Seshia et al.OOPSLA 2025 · 2 citations
- ParSEval: Plan-aware Test Database Generation for SQL Equivalence EvaluationChunyu Chen, Zhengjie Miao, Yong Zhang, Jiannan WangVLDB 2025 · 1 citation
Builds on3
- Data Migration using Datalog Program SynthesisYuepeng Wang, Rushi Shah, Abby Criswell, Rong Pan et al.VLDB 2020 · 30 citations
- SPES: A Symbolic Approach to Proving Query Equivalence Under Bag SemanticsQi Zhou, Joy Arulraj, Shamkant B. Navathe, William Harris et al.ICDE 2022 · 19 citations
- Deductive optimization of relational data storageJohn K. Feser, Sam Madden, Nan Tang, Armando Solar-LezamaOOPSLA 2020 · 5 citations
Related papers
- Proving Query Equivalence Using Linear Integer ArithmeticHaoran Ding, Zhaoguo Wang, Yicun Yang, Dexin Zhang et al.SIGMOD 2024 · 20 citations
- Polygon: Symbolic Reasoning for SQL using Conflict-Driven Under-Approximation SearchPinhan Zhao, Yuepeng Wang, Xinyu WangPLDI 2025
- QED: A Powerful Query Equivalence Decider for SQLShuxian Wang, Sicheng Pan, Alvin CheungVLDB 2024 · 19 citations
- Skeletal approximation enumeration for SMT solver testingPeisen Yao, Heqing Huang, Wensheng Tang, Qingkai Shi et al.FSE 2021 · 20 citations
- Translating canonical SQL to imperative code in CoqVéronique Benzaken, Evelyne Contejean, Mohammed Houssem Hachmaoui, Chantal Keller et al.OOPSLA 2022 · 3 citations
