Towards a Logical Semantics for Referential Actions in SQL

Bertram Ludäscher, Wolfgang May, Joachim Reinert

Abstract. We investigate a logical semantics which unambiguously specifies the meaning of SQL-like referential actions of the form ON DELETE CASCADE and ON DELETE RESTRICT. The semantics is given by a translation of referential actions into logical rules. The proposed semantics is less restrictive than the standard SQL semantics, yet preserves all referential integrity constraints. First, a preliminary set of rules is introduced which rejects a set of user requests if a single request is rejected. Subsequently, a refined translation is presented using Statelog, a state-oriented Datalog extension which allows to define active and deductive rules within a unified framework. We show that our semantics yields the maximal admissible subset of a given set of user requests. Apart from the Statelog formalization, a three-valued formalization based on the well-founded semantics and an equivalent game-theoretic specification are presented, which give further insight into the problem of ambiguity of triggers.

[PDF File] [PS File] [PS Slides of the talk]