dbTalk Databases Forums  

A different definition of MINUS, part 4

comp.databases.theory comp.databases.theory


Discuss A different definition of MINUS, part 4 in the comp.databases.theory forum.



Reply
 
Thread Tools Display Modes
  #151  
Old   
Bob Badour
 
Posts: n/a

Default Re: A different definition of MINUS, part 4 - 01-09-2009 , 12:59 PM






paul c wrote:

Quote:
Bob Badour wrote:
...

can be got without Forall, as long as we have projection. I gather
that 'full relation' often means a cartesian product.


Just a relation expressing all of what all is. In the suppliers/parts
example, one might group parts from SP into a relation valued
attribute and then compare that against the P relation projected on {P}

I am unsure of the exact notation but something like:

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

Excellent! It hadn`t occurred to me to use GROUP this way. Seems to
take advantage of the way GROUP always implies a key or fd that might
not have been present without GROUP.
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'.

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.


Reply With Quote
  #152  
Old   
paul c
 
Posts: n/a

Default Re: A different definition of MINUS, part 4 - 01-09-2009 , 03:42 PM






Bob Badour wrote:
....
Quote:
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"?

Quote:
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.


Reply With Quote
  #153  
Old   
Bob Badour
 
Posts: n/a

Default Re: A different definition of MINUS, part 4 - 01-09-2009 , 04:14 PM



paul c wrote:

Quote:
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.


Quote:
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.


Reply With Quote
  #154  
Old   
paul c
 
Posts: n/a

Default Re: A different definition of MINUS, part 4 - 01-09-2009 , 07:34 PM



Bob Badour wrote:
....
Quote:
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.
I suspect so too. It's been many years since I used any SQL products much, maybe some of them have a relation comparison operation now, but I don't remember any. My hunch is that any implementation language that doesn't have such an op is not likely to be defined on much formal logic.


Reply With Quote
  #155  
Old   
Bob Badour
 
Posts: n/a

Default Re: A different definition of MINUS, part 4 - 01-09-2009 , 09:20 PM



paul c wrote:

Quote:
Bob Badour wrote:
...

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.

I suspect so too. It's been many years since I used any SQL products
much, maybe some of them have a relation comparison operation now, but I
don't remember any. My hunch is that any implementation language that
doesn't have such an op is not likely to be defined on much formal logic.
I strongly doubt any SQL dbms supports table comparison. I have no doubt
the vendors would say "That would be too slow and expensive" instead of
doing their jobs.


Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.3
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.