Re: Relational query with path expressions
- From: David BL <davidbl@xxxxxxxxxxxx>
- Date: Thu, 2 Apr 2009 22:41:39 -0700 (PDT)
On Apr 3, 12:46 pm, Tegiri Nenashi <TegiriNena...@xxxxxxxxx> 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, although union, difference, and renaming still have to be
explicit?
Yes union, intersection and difference must be explicit. For example,
P[WEIGHT > 16].P# union SP[S# = 'S2'].P#
to retrieve the part numbers for parts that either weigh more than 16
pounds or are supplied by supplier S2 or both.
Of course quite often these set theoretic operators can be mapped to
boolean operators inside a restriction. E.g.,
P[WEIGHT > 16 or 'S2' in SP.S.S#].P#
I think equivalence of these depends on a FK constraint from SP.P# to
P.P#.
I was thinking rename could be made more convenient by embellishing
the syntactic sugar that the asterisk already provides. Normally the
asterisk expands into all the attribute names from the input relation.
For example,
P( *(-COLOR, WEIGHT as W), SP.S.SNAME )
is equivalent to
P( P#, PNAME, WEIGHT as W, CITY, SP.S.SNAME )
.
- References:
- Relational query with path expressions
- From: David BL
- Re: Relational query with path expressions
- From: Tegiri Nenashi
- Relational query with path expressions
- Prev by Date: Re: Relational query with path expressions
- Next by Date: Re: Relational query with path expressions
- Previous by thread: Re: Relational query with path expressions
- Next by thread: Re: Relational query with path expressions
- Index(es):
Relevant Pages
|