Synthesizing Analytical SQL Queries from Computation Demonstration
Xiangyu Zhou, Rastislav Bodik, Alvin Cheung, Chenglong Wang

TL;DR
This paper introduces Sickle, a tool that synthesizes analytical SQL queries from cell-level computation demonstrations, significantly improving efficiency and success rate over prior methods.
Contribution
It proposes a novel programming by computation demonstration approach and an abstraction-based synthesis algorithm for analytical SQL query generation.
Findings
Sickle solves 76 out of 80 real-world tasks in 12.8 seconds on average.
Prior approaches solve only 60 tasks and are 22.5x slower.
User study shows increased efficiency and confidence with the new specification.
Abstract
Analytical SQL is widely used in modern database applications and data analysis. However, its partitioning and grouping operators are challenging for novice users. Unfortunately, programming by example, shown effective on standard SQL, are less attractive because examples for analytical queries are more laborious to solve by hand. To make demonstrations easier to create, we designed a new end-user specification, programming by computation demonstration, that allows the user to demonstrate the task using a (possibly incomplete) cell-level computation trace. This specification is exploited in a new abstraction-based synthesis algorithm to prove that a partially formed query cannot be completed to satisfy the specification, allowing us to prune the search space. We implemented our approach in a tool named Sickle and tested it on 80 real-world analytical SQL tasks. Results show that…
Peer Reviews
No public reviews on file for this paper yet. If you reviewed it on a platform where reviews are public (OpenReview, ICLR, NeurIPS, ICML), you can paste yours below so the community can read it here.
Videos
No videos yet. Explain this paper in a talk, walkthrough, or lecture? Add one.
