Let's say we are given this table of the relation Person(name, hobby)
name hobby
bob hockey
alice basketball
mary cricket
mark basketball
rick snowboarding
andy hockey
How would I use relational algebra to find the hobby that had only one person had.
It should give me
hobby
cricket
snowboarding
My ATTEMPT:
$R1 := \rho_{P2}(Person)$
$R2 := R1 \bowtie_{P2.hobby = P1.hobby \text{ } AND \text{ } P2.name <> P1.name} R2$
$R3 := \pi_{hobby} (R2)$