Question: Which of the following is the key of a relation schema R = (M, N, O, P, S, T), when R has the functional dependencies shown below?
O → T
S → M
OS → P
M → N
a) MO b) MS c) OP d) OS
Explanation:
To determine the key of the relation schema given the functional dependencies, we need to figure out the minimal set of attributes that can determine all the attributes of the relation. This minimal set is the candidate key.
Functional Dependencies:
Step 1: Identify which attributes can be derived
- From , if we have , we can determine .
- From , if we have , we can determine .
- From , if we know , we can determine .
- From , if we know both and , we can determine .
Step 2: Determine the closure of attribute sets
We need to check the closure of the given sets of attributes to find which set determines all attributes
1. Closure of :
- so with , we get .
- , so with , we get .
- But we can't determine or , so is not a key.
2. Closure of :
- , so with , we get .
- From , we can determine .
- However, we can't determine , , or , so is not a key.
3. Closure of :
- doesn't help much directly since none of the dependencies involve determining anything else.
- So is not a key.
4. Closure of :
- From , we can determine .
- From , we can determine .
- From , we can determine .
- From , we can determine .
- Therefore, determines all attributes
Conclusion:
The closure of contains all the attributes of the relation, so is the key of the relation schema.
Thus, the correct answer is d) OS.
Comments
Post a Comment