Re: curiousity of sets of no relations?



paul c wrote:

In his Intro to DB, 8th Ed., page 195 in the Relational Algebra chapter, CJ Date says:

(Quote, with point numbers added and asterisks for footnotes)
Some Generalizations

JOIN, UNION, and INTERSECTION were all defined originally as dyadic operators (i.e., each took exactly two relations as operands);* as we have seen, however, they can be unambiguously generalized to become n-adic operators for arbitrary n> 1. But what about n=1? Or n=0? It turns out to be desireable, at least from a conceptual point of view, to be able to perform "joins", "unions", and "intersections" of (a) just a single relation and (b) no relations at all (even though Tutorial D provides no direct syntactic support for any such operations). Here are the definitions. Let s be a set of relations (all of the same relation type RT in the case of union and intersection). Then:

(1) If s contains just one relation r, then the join, union, and intersection of all relations in s are all defined to be simply r.

(2) If s contains no relations at all, then:

(2.1) The join of all relations in s is defined to be TABLE_DEE (the identity with respect to join).

(2.2) The union of all relations in s is defined to be the empty relation of type RT.

(2.3) The intersection of all relations in s is defined to be the "universal" relation of type RT - that is, that unique relation of type RT that contains all possible tuples with heading H, where H is the heading of type RT.**

* MINUS is dyadic, too. By contrast, restrict and project are monodic operators.

** We note in passing that the term universal relation is usually used in the literature with a very different meaning. ...

(End of quote)

In the exercises for that chapter (#7.10), Date asks "Given that intersect is a special case of join, why do not both operators give the same result when applied to no relations at all?"

My guess at the motivation for all this is that it is at least partly to define things completely enough to allow prefix notation, eg. JOIN/INTERSECT/UNION (r1, r2, ... , rn). If that's so, then I can see that we would want JOIN() (by this I mean the JOIN of nothing) to give TABLE_DEE, if we wanted (JOIN())JOIN(r1) to give r1. Similarly for INTERSECT() and other combinations of the three operators.

That seems a practical motivation. In terms of relations and/or set theory/predicate calculus can anybody give a more theoretical one?

He simply defined them as the identity elements for the specific operations just as one defines any aggregate/fold of zero elements using the identity element for the base operation.
.



Relevant Pages

  • curiousity of sets of no relations?
    ... (Quote, with point numbers added and asterisks for footnotes) ... Let s be a set of relations (all of the same relation type RT in the case of union and intersection). ... That seems a practical motivation. ...
    (comp.databases.theory)
  • Re: How to decide on the meet operator in Data-flow Analysis?
    ... In an iterative data flow analysis the solution obtained will be less ... where meet operator is U (union) ... where the meet operator is (intersection) ... Note that the algorithm gives you "MUST" information. ...
    (comp.compilers)
  • Re: Corners in metric spaces
    ... and a ball are both smooth in an intuitive sense. ... Neither has their union ... the intersection of B_i and boundary of S is empty ... to get scetch of proof or counterexample of Sentence 2 ...
    (sci.math)
  • Re: Junk Dna!
    ... elements are not present at internal nodes in a nested hierarchy. ... consequence of the definition of intersection. ... A, can be in union with B,C & D at the same time! ...
    (talk.origins)
  • Re: Lazy question about De Morgans Laws
    ... the complement of a union is the intersection of the ... closed sets, and the fact that we are only allowed to take infinite ...
    (sci.math)