Re: Relational Algebra Expression



gamehack wrote:

On Feb 9, 4:47 pm, Bob Badour <bbad...@xxxxxxxxxxxxxxxx> 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.
.



Relevant Pages

  • Re: Relational Algebra Expression
    ... projection on Year so that I can remove duplicates but then I can't ... I would use "rename all but year prepending ...
    (comp.databases.theory)
  • Re: Relational Algebra Expression
    ... projection on Year so that I can remove duplicates but then I can't ... It would be just peachy keen if it didn't look so much like it had a bug then. ...
    (comp.databases.theory)
  • Re: Relational Algebra Expression
    ... projection on Year so that I can remove duplicates but then I can't ... It would be just peachy keen if it didn't have a bug. ...
    (comp.databases.theory)
  • Re: Relational Algebra Expression
    ... JOG wrote: ... projection on Year so that I can remove duplicates but then I can't ...
    (comp.databases.theory)
  • Re: Idempotence and "Replication Insensitivity" are equivalent ?
    ... projection, although mathematical projection ... duplicates), and you apply SQL *as if you were operating on sets*, you ... you know that I'm not a purist about always following normalization rules. ... that database theory is irrelevant. ...
    (comp.databases.theory)