Re: A different definition of MINUS, part 4

From: Bob Badour <bbadour_at_pei.sympatico.ca>
Date: Fri, 09 Jan 2009 18:14:57 -0400
Message-ID: <4967cc48$0$5465$9a566e8b_at_news.aliant.net>


paul c wrote:

> Bob Badour wrote:
> ...
> 

>> As I said, I am unsure of the notation. Above, I more-or-less assumed
>> that GROUP would create a relation valued attribute from some
>> specified set of attributes while projecting on the remaining
>> attributes, but one probably wants to group things other than
>> attributes in a single relation, and one probably wants the option to
>> project on an arbitrary set of attributes.
>>
>> Ignoring those notation problems, though, I assume you see how that
>> more-or-less expresses "Suppliers who supply all parts."
>>
>> One could replace P{P} with any expression answering "All of what?"
>> For example, "Suppliers who supply all the green parts." might be:
>>
>> (SP{S,P} GROUP Parts{P} | Parts = (P | COLOR='green'){P}){S}
>>
>> assuming the P relation has a COLOR attribute and one of the possible
>> values is 'green'.
>> ...
> 
> Yes, I can see `all parts` and `all green parts`, as long as there are 
> some green parts.  If there aren`t any green parts, I`d say we get the 
> same answer as Codd`s Divide, in which all suppliers might not appear.  
> Is that why you said "one probably wants to group things other than 
> attributes in a single relation"?

Actually, there was a mistake in what I wrote:

(SP{S,P} GROUP Parts{P} |

   (Parts join (P | COLOR='green')){P} = (P | COLOR='green'){P} ){S}

Alternatively, one could use a "contains" comparison rather than an "equals" comparison.

The corrected expression would return all suppliers in SP if there are no green parts. One would have to adjust it to return all suppliers in S, and yes, to do that adjustment, one would have to have a better GROUP notation.

>> I used the vertical bar for RESTRICT similar to set notation, which I
>> generally read as "such that", and {} for PROJECT. Although, I have to
>> say that as my eyes age, I like notations that use both () and {} less
>> and less.

> 
> I'm okay with the bar, took it as a kind of cumulative <AND>, probably 
> saves a lot of fiddly typing to express conversions.

One could replace both join and | with <AND> and get rid of most of the brackets.

The notation may also have some name scoping issues, but I think we are both on the same page about the relation equality comparison providing both quantifiers to the algebra. Received on Fri Jan 09 2009 - 23:14:57 CET

Original text of this message