Let be the following simplified database sketch:

  • R1(P,S),R2(S,T) and R3(T,S) with P= people S = Sport and T= Sports Center

How to find in relational algebra and relational calculus which couples such that each one has at least a sport that the other do and and another that the other do not.

I tried:

Πp1,p2s1!=s2, p1!=p2(R1))P→P1,P→P2, S→S1, S→S2

But I know this is wrong, It doesn't express the second condition at least and I'm not sure on how to express variables renaming.

Can you help me express such inclusive and exclusive relations?

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.