Proceedings of the VLDB Endowment · 2017 · 54 citations · 20 references
ComputingComputer ScienceDatabasesLogicSemanticsDatabase ManagementFormal SemanticsQuery ProcessingRelational AlgebraRelational DatabasesStructured Query LanguageNull SemanticsQuery EquivalenceRelational CalculusRelational Calculus EquivalenceRelational Query ProcessingSql Query LanguagesSql SyntaxThree-valued Logic
While formal semantics of theoretical languages underlying SQL have been provided in the past, they all made simplifying assumptions ranging from changes in the syntax to omitting bag semantics and nulls. This situation is reminiscent of what happens in the field of programming languages, where semantics of formal calculi underlying the main features of languages are abundant, but formal semantics of real languages that people use are few and far between. We consider the basic class of SQL queries --- essentially SELECT-FROM-WHERE queries with subqueries, set/bag operations, and nulls --- and define a formal semantics for it, without any departures from the real language. This fragment already requires decisions related to the data model and handling variable names that are normally disregarded by simplified semantics. To justify our choice of the semantics, we validate it experimentally on a large number of randomly generated queries and databases. We give two applications of the semantics. One is the first formal proof of the equivalence of basic SQL and relational algebra that extends to bag semantics and nulls. The other application looks at the three-valued logic employed by SQL, which is universally assumed to be necessary to handle nulls. We prove however that this is not so, as three-valued logic does not add expressive power: every SQL query in our fragment can be evaluated under the usual two-valued Boolean semantics of conditions.
20
Choice Reviews Online · 1995 · 1.8K citations
Semantics of programming languages: structures and techniques
Choice Reviews Online · 1993 · 422 citations
Revised5 Report on the Algorithmic Language Scheme
Hal Abelson, R. Kent Dybvig, Christopher T. Haynes et al. · LISP and Symbolic Computation · 1998 · 414 citations
Concepts in programming languages
Choice Reviews Online · 2003 · 397 citations
A data base sublanguage founded on the relational calculus
E. F. Codd · 1971 · 373 citations