Q28.Marks: +2.0UGC NET Paper 2: Computer Science17th June 2023
Let R (A, B, C, D, E, F) be a relational schema with following functional dependencies:
C → F, E → A, EC → D, A → B. Which of the following is a key for R?
1.CD
2.EC✓ Correct
3.AE
4.AC
Solution
The correct answer is EC
Key Points
EXPLANATION:
In order to find the key for a relational schema, we need to find a minimal set of attributes which can determine all other attributes. This is usually done by calculating the closure of each set of attributes.Given the functional dependencies:
C → F, E → A, EC → D, A → B
Let's compute the closure of each candidate key:
For CD closure: CD C gives F by the dependency C → F. But no other attributes can be determined. So, CD closure is CDF. It does not include all attributes.
For EC closure: EC E gives A by the dependency E → A, and EC gives D by the dependency EC → D. Then, A gives B. Now we have ECABDF which includes all the attributes.
So, the key for R is EC.
Mistake PointsAbove Official question some mistake in data R (A, B, C, D, F) the relation mention attribute F but option they don't give F in any key pair so we have change the relation R (A, B, C, D, E, F) and solve them.