I have these relational schemes:
Participate (FestivalName, Artist)
Attend(ID, FestivalName)
Prefer (ID, FestivalName)
Like (ID, Artist)
I would like to list the people which only attend festivals that are not of their preference and that at the same time, in one of those festivals, at least two artists that they like participated (so, 2 or more). Finally, show the ID and the festival.
I would like to solve this by using common operators:
selection operator, projection operator, union operator, difference operator and cartesian product
This is an example:
ATTEND TABLE
147|HannaBalusa |
147|FestivalTOP |
147|BestFestival|
PREFER TABLE
147|FestivalTOP|
LIKE TABLE
147|PaulMackarney|
147|BobDeylan |
PARTICIPATE TABLE
HannaBalusa |PaulMackarney |
HannaBalusa |BobMurley |
FestivalTOP |BobDeylan |
BestFestival|PaulMackarney |
BestFestival|BobDeylan |
So, i should obtain this output:
147|BestFestival
I can solve this situation by using SQL but i'm having trouble using relational algebra.
Can help me?