# Re: Algebra expression for MINUS

From: Paul Gearon <gearon@ieee.org>
Date: Wed, 8 Jul 2009 14:20:06 -0500
Message-ID: <a25ac1f0907081220g6021be7er440d6d9f5dfd187b@mail.gmail.com>
To: Simon Schenk <sschenk@uni-koblenz.de>

```On Wed, Jul 8, 2009 at 11:31 AM, Simon Schenk<sschenk@uni-koblenz.de> wrote:
> Hi,
>
> I've been fiddling with algebra expressions for MINUS and I am wondering
> whether the following capture the semantics of antijoin with restriction
> to shared variables:
>
> A \ (A |X| [Projection to vars in A] B)
>
> If A and B do not share a variable, the projection results in a relation
> with zero colums. I am not sure, whether this is even defined.
>
> Does anyone of the relational algebra gurus out there have a clue?

Not a guru, but this is similar to how I described it in that link no
one ever comments on.  :-) In my case, I describe it as:

A intersection ([project to vars in A] complement (A |X| B))

Where "complement" is defined in terms of the known data (ie. the
assertions in the database). By this definition,
"intersection-complement" should be equivalent to your \ operator.
Also, the projection can be done before or after the inner join and
complement with the same result.

So yes, I agree with you.

(BTW, the actual notation I used was:  A - B = A ∩ π(¬'(A ⋈ B))
but I don't know how well that will show up in email)

Regards,
Paul
```
Received on Wednesday, 8 July 2009 19:20:48 UTC

This archive was generated by hypermail 2.3.1 : Wednesday, 7 January 2015 15:00:57 UTC