Re: Relational Algebra Expression

From: Bob Badour <bbadour_at_pei.sympatico.ca>
Date: Sat, 09 Feb 2008 13:12:00 -0400
Message-ID: <47addee3$0$4067$9a566e8b_at_news.aliant.net>


gamehack wrote:

> On Feb 9, 4:47 pm, Bob Badour <bbad..._at_pei.sympatico.ca> wrote:
>

>>gamehack wrote:
>>[snip]
>>
>>>What I'm trying to do is extract all the years where we have more than
>>>1 relation for the year. For the sample table, we need to get:
>>>1999
>>>2001
>>
>>>I tried to do in a couple of ways but I couldn't. I tried using a
>>>projection on Year so that I can remove duplicates but then I can't
>>>just use difference because the new relations are not compatible. Any
>>>hints are greatly appreciated.
>>
>>Equijoin on year and inequality theta-join on name project on year.

>
> Hi,
>
> I can't really understand what this means - can you bracket it so I
> can see the results of each operation?
>
> Thanks very much,
> g

Read it left to right, like you would any other english sentence, and think about the result after each operation. How many of each year will you have after each step?

Ask yourself whether it works for "more than 1". Ask yourself whether it generalizes to "more than n".

Then, think about how you would write it in whatever algebraic syntax you are using. Received on Sat Feb 09 2008 - 18:12:00 CET

Original text of this message