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 even from small demonstrations, Sickle can solve 76 tasks, in 12.8 seconds on average, while the prior approaches can solve only 60 tasks and are on average 22.5x slower. Our user study with 13 participants reveals that our specification increases user efficiency and confidence on challenging tasks.
翻译:分析 SQL 被广泛用于现代数据库应用程序和数据分析。然而,它的分割和分组操作器对于新用户来说具有挑战性。 不幸的是,在标准 SQL 中显示有效的实例编程不那么具有吸引力,因为分析查询的示例更难手工解决。为了使演示更加容易创建,我们设计了一个新的终端用户规格,通过计算演示编程,使用户能够使用一个(可能不完整的)细胞级计算跟踪来展示任务。该规格在基于抽象的新的合成算法中被利用,以证明一个部分组成的查询无法满足规格要求,允许我们利用搜索空间。我们用一个名为 " 镰刀 " 的工具实施了我们的方法,并在80个真实世界分析 SQL 任务中测试了它。结果显示,即使从小的演示中, " 镰刀 " 可以平均在12.8秒内解决76项任务,而先前的方法只能解决60项任务,平均慢化22.5x。我们13名参与者的用户的研究显示,我们的规格提高了用户对挑战性任务的效率和信心。