Re: Relational query with path expressions

From: David BL <>
Date: Sun, 5 Apr 2009 20:08:29 -0700 (PDT)
Message-ID: <>

On Apr 3, 12:46 pm, Tegiri Nenashi <> wrote:
> Granted, if you have a choice between join and generalized projection
> you can infer the type of binary operator from the type of operand. In
> the expression
> x.y
> if both are relations, you interpret it as join, and if one is a set
> of attributes, than its a projection. That is some economy of
> notation.

It occurred to me that the same language can be formalised more simply and without any need to overload the dot syntax. The relevant rules are:

  1. R1.R2 always means project the join of R1 and R2 onto the attributes of R2
  2. (R1,...,Rn) always means the join of R1,...,Rn
  3. x where x is an attribute name represents a relation with a single attribute named x, and containing all the tuples associated with the domain of attribute x. Often these relations are infinite and can't be materialised.

This makes it clear for example that

    SP.(QTY,P) is equivalent to what Date would write as

    (SP JOIN P) { QTY, P#, PNAME, COLOR, WEIGHT, CITY } Providing access to (finite) domains as relations has other uses. E.g.

    COLOR \ P.COLOR to find the colours not used by any part.

The downside is that each attribute name must consistently use the same domain type in all relations it appears in. Received on Sun Apr 05 2009 - 22:08:29 CDT

Original text of this message