מושגי ליבה
Qr-Hint provides a step-by-step approach to guide users in editing their working SQL queries to make them semantically equivalent to a target reference query, without revealing the reference query.
תקציר
The paper presents Qr-Hint, a system that helps users fix incorrect SQL queries by providing actionable hints. The key ideas are:
Qr-Hint follows a stage-based approach, focusing on different syntactic fragments of the working query (FROM, WHERE, GROUP BY, HAVING, SELECT) one at a time. At each stage, it provides hints to edit the current fragment in a way that brings the working query closer to being semantically equivalent to the target reference query.
Qr-Hint aims to suggest the "smallest" possible edits to the working query, as it is often impossible to declare any part of the working query as definitively "wrong". It formulates the problem of finding repair sites and fixes in the working query as an optimization problem, leveraging SMT solvers for reasoning.
Qr-Hint provides guarantees on the progress and correctness of the hints - each hint is actionable and leads the user closer to the final correct query, which is guaranteed to be semantically equivalent to the target query, even if syntactically different.
The paper evaluates Qr-Hint's performance and effectiveness through experiments and a user study, showing that it can find high-quality repairs in reasonable time and provide helpful hints to students in an educational setting.