首页> 外文会议>International conference on formal engineering methods >SqlSol: An accurate SQL Query Synthesizer
【24h】

SqlSol: An accurate SQL Query Synthesizer

机译:SQLSOL:精确的SQL查询合成器

获取原文

摘要

SQL is the programming language for communicating with relational databases, but writing SQL queries is challenging for many end users due to lack of programming knowledge. In this paper, we present an efficient and accurate algorithm that helps users to synthesize SQL queries from IO examples, which is the first algorithm to encode SQL synthesis problem into constraint-solving problem. We propose an axiom that encodes the semantics of a SQL query into logic constraints, and decompose the SQL synthesis problem into two parts: problem-encoding and constraint-solving. For the problem-encoding part, we use a SQL template that is same as prior work and parameterize it, then based on this axiom, we encode the parameters into logic constraints. For the constraint-solving part, we use the off-the-shelf modern SMT solvers. Our algorithm supports multiple IO examples, therefore users can add more examples to refine the solution until a correct one is found. We implemented a tool, SqlSol, and evaluated it on 171 benchmarks. The results showed that it efficiently solved 68% of the benchmarks in 3 s in average. For those SqlSol cannot solve, SqlSol terminated in 4 s in average.
机译:SQL是用于与关系数据库进行通信的编程语言,但由于缺乏编程知识,编写SQL查询对许多最终用户来说是具有挑战性的。在本文中,我们提出了一种有效且准确的算法,其可帮助用户从IO示例中综合SQL查询,这是将SQL合成问题编码为约束解决问题的第一算法。我们提出了一个公理,它将SQL查询的语义编码为逻辑约束,并将SQL合成问题分解为两个部分:问题编码和约束求解。对于编码部分,我们使用与先前工作相同的SQL模板和参数化,然后基于此Axiom,我们将参数编码为逻辑约束。对于求解部分,我们使用现成的现代SMT溶剂。我们的算法支持多个IO示例,因此用户可以添加更多示例以优化解决方案,直到找到正确的解决方案。我们在171个基准测试中实现了一个工具,SQLSOL和评估它。结果表明,它平均有效地解决了3秒的68%的基准。对于那些SQLSOL无法解决,SQLSOL平均终止于4秒。

著录项

相似文献

  • 外文文献
  • 中文文献
  • 专利
获取原文

客服邮箱:kefu@zhangqiaokeyan.com

京公网安备:11010802029741号 ICP备案号:京ICP备15016152号-6 六维联合信息科技 (北京) 有限公司©版权所有
  • 客服微信

  • 服务号