Qr-Hint: Actionable Hints Towards Correcting Wrong SQL Queries

Author:

Hu Yihao1ORCID,Gilad Amir2ORCID,Stephens-Martinez Kristin1ORCID,Roy Sudeepa1ORCID,Yang Jun1ORCID

Affiliation:

1. Duke University, Durham, NC, USA

2. Hebrew University, Jerusalem, Israel

Abstract

We describe a system called Qr-Hint that, given a (correct) target query Q* and a (wrong) working query Q, both expressed in SQL, provides actionable hints for the user to fix the working query so that it becomes semantically equivalent to the target. It is particularly useful in an educational setting, where novices can receive help from Qr-Hint without requiring extensive personal tutoring. Since there are many different ways to write a correct query, we do not want to base our hints completely on how Q* is written; instead, starting with the user's own working query, Qr-Hint purposefully guides the user through a sequence of steps that provably lead to a correct query, which will be equivalent to Q* but may still "look" quite different from it. Ideally, we would like Qr-Hint's hints to lead to the "smallest" possible corrections to Q. However, optimality is not always achievable in this case due to some foundational hurdles such as the undecidability of SQL query equivalence and the complexity of logic minimization. Nonetheless, by carefully decomposing and formulating the problems and developing principled solutions, we are able to provide provably correct and locally optimal hints through Qr-Hint. We show the effectiveness of Qr-Hint through quality and performance experiments as well as a user study in an educational setting.

Funder

NSF

Publisher

Association for Computing Machinery (ACM)

Reference56 articles.

1. Serge Abiteboul, Richard Hull, and Victor Vianu. 1995. Foundations of databases: the logical level. Addison-Wesley Longman Publishing Co., Inc.

2. Students' Semantic Mistakes in Writing Seven Different Types of SQL Queries

3. Umair Z. Ahmed, Zhiyu Fan, Jooyong Yi, Omar I. Al-Bataineh, and Abhik Roychoudhury. 2022. Verifix: Verified Repair of Programming Assignments. , Vol. 31, 4, Article 74 (jul 2022), bibinfonumpages31 pages.

4. Equivalences among Relational Expressions

5. Marcelo Arenas Pablo Barceló Leonid Libkin Wim Martens and Andreas Pieris. 2022. Database Theory. Open source at https://github.com/pdm-book/community.

Cited by 1 articles. 订阅此论文施引文献 订阅此论文施引文献,注册后可以免费订阅5篇论文的施引文献,订阅后可以查看论文全部施引文献

1. What Teaching Databases Taught Us about Researching Databases: Extended Talk Abstract;Proceedings of the 3rd International Workshop on Data Systems Education: Bridging education practice with education research;2024-06-09

同舟云学术

1.学者识别学者识别

2.学术分析学术分析

3.人才评估人才评估

"同舟云学术"是以全球学者为主线,采集、加工和组织学术论文而形成的新型学术文献查询和分析系统,可以对全球学者进行文献检索和人才价值评估。用户可以通过关注某些学科领域的顶尖人物而持续追踪该领域的学科进展和研究前沿。经过近期的数据扩容,当前同舟云学术共收录了国内外主流学术期刊6万余种,收集的期刊论文及会议论文总量共计约1.5亿篇,并以每天添加12000余篇中外论文的速度递增。我们也可以为用户提供个性化、定制化的学者数据。欢迎来电咨询!咨询电话:010-8811{复制后删除}0370

www.globalauthorid.com

TOP

Copyright © 2019-2024 北京同舟云网络信息技术有限公司
京公网安备11010802033243号  京ICP备18003416号-3