Consider a database that includes the following relations:
Defender(name, rating, side, goals)
Forward(name, rating, assists, goals)
Team(name, club, price)
Which ONE of the following relational algebra expressions checks that every name occurring in Team appears in either Defender or Forward, where \(\phi\) denotes the empty set?
Answer
(C)
Explanation
The condition says that the set of Team names is contained in the set of names that occur in Defender or Forward:
\[\Pi_{\mathit{name}}(\text{Team}) \subseteq \Pi_{\mathit{name}}(\text{Defender}) \cup \Pi_{\mathit{name}}(\text{Forward}).\]
A set \(A\) is a subset of \(B\) exactly when \(A \setminus B = \phi\): nothing in \(A\) is left over after removing the members of \(B\). That is option C.
- A uses \(\cap\), so it would demand that every Team name occur in both Defender and Forward.
- B and D test the opposite inclusion, that the players' names all occur in Team.
Answer: C