当前位置: X-MOL 学术arXiv.cs.LO › 论文详情
Our official English website, www.x-mol.net, welcomes your feedback! (Note: you will need to create a separate account there.)
A Formalization of SQL with Nulls
arXiv - CS - Logic in Computer Science Pub Date : 2020-03-25 , DOI: arxiv-2003.11331
Wilmer Ricciotti and James Cheney

SQL is the world's most popular declarative language, forming the basis of the multi-billion-dollar database industry. Although SQL has been standardized, the full standard is based on ambiguous natural language rather than formal specification. Commercial SQL implementations interpret the standard in different ways, so that, given the same input data, the same query can yield different results depending on the SQL system it is run on. Even for a particular system, mechanically checked formalization of all widely-used features of SQL remains an open problem. The lack of a well-understood formal semantics makes it very difficult to validate the soundness of database implementations. Although formal semantics for fragments of SQL were designed in the past, they usually did not support set and bag operations, nested subqueries, and, crucially, null values. Null values complicate SQL's semantics in profound ways analogous to null pointers or side-effects in other programming languages. Since certain SQL queries are equivalent in the absence of null values, but produce different results when applied to tables containing incomplete data, semantics which ignore null values are able to prove query equivalences that are unsound in realistic databases. A formal semantics of SQL supporting all the aforementioned features was only proposed recently. In this paper, we report about our mechanization of SQL semantics covering set/bag operations, nested subqueries, and nulls, written the Coq proof assistant, and describe the validation of key metatheoretic properties.

中文翻译:

带有空值的 SQL 形式化

SQL 是世界上最流行的声明性语言,是价值数十亿美元的数据库行业的基础。虽然 SQL 已经标准化,但完整的标准是基于模糊的自然语言而不是正式的规范。商业 SQL 实现以不同的方式解释标准,因此,在给定相同的输入数据的情况下,根据运行它的 SQL 系统,相同的查询可以产生不同的结果。即使对于特定系统,对 SQL 的所有广泛使用的特性进行机械检查的形式化仍然是一个悬而未决的问题。缺乏易于理解的形式语义使得验证数据库实现的健全性变得非常困难。尽管过去为 SQL 片段设计了形式语义,但它们通常不支持 set 和 bag 操作、嵌套子查询,而且至关重要的是,空值。空值以类似于空指针或其他编程语言中的副作用的深刻方式使 SQL 的语义复杂化。由于某些 SQL 查询在没有空值的情况下是等效的,但在应用于包含不完整数据的表时会产生不同的结果,因此忽略空值的语义能够证明在现实数据库中不合理的查询等效性。支持所有上述功能的 SQL 的正式语义是最近才提出的。在本文中,我们报告了我们的 SQL 语义机械化,涵盖了 set/bag 操作、嵌套子查询和 null,编写了 Coq 证明助手,并描述了关键元理论属性的验证。s 语义以深刻的方式类似于其他编程语言中的空指针或副作用。由于某些 SQL 查询在没有空值的情况下是等效的,但在应用于包含不完整数据的表时会产生不同的结果,因此忽略空值的语义能够证明在现实数据库中不合理的查询等效性。支持所有上述功能的 SQL 的正式语义是最近才提出的。在本文中,我们报告了我们的 SQL 语义机械化,涵盖了 set/bag 操作、嵌套子查询和 null,编写了 Coq 证明助手,并描述了关键元理论属性的验证。s 语义以深刻的方式类似于其他编程语言中的空指针或副作用。由于某些 SQL 查询在没有空值的情况下是等效的,但在应用于包含不完整数据的表时会产生不同的结果,因此忽略空值的语义能够证明在现实数据库中不合理的查询等效性。支持所有上述功能的 SQL 的正式语义是最近才提出的。在本文中,我们报告了我们的 SQL 语义机械化,涵盖了 set/bag 操作、嵌套子查询和 null,编写了 Coq 证明助手,并描述了关键元理论属性的验证。忽略空值的语义能够证明在现实数据库中不合理的查询等价。支持所有上述功能的 SQL 的正式语义是最近才提出的。在本文中,我们报告了我们的 SQL 语义机械化,涵盖了 set/bag 操作、嵌套子查询和 null,编写了 Coq 证明助手,并描述了关键元理论属性的验证。忽略空值的语义能够证明在现实数据库中不合理的查询等价。支持所有上述功能的 SQL 的正式语义是最近才提出的。在本文中,我们报告了我们的 SQL 语义机械化,涵盖了 set/bag 操作、嵌套子查询和 null,编写了 Coq 证明助手,并描述了关键元理论属性的验证。
更新日期:2020-03-26
down
wechat
bug