How to determine the candidate key by functional dependancies in relational database theory

45 views Asked by At

Consider a database relation of student records as follows: Student (I,G,P,M,S,Y,E,L,R,C)

(a) Show how to derive two candidate keys for Student, or justify why you cannot do so.

(b) What normal form is Student in? Show working that justifies your answer.

(c) If F contained MSY→LRCE instead of PMSY→LRCE, what would this imply about paper names? (i.e., the values of M)

(d) Find a minimal cover (i.e, an irreducible set of functional dependencies) for Student.

(e) Find a decomposition of Student into third normal form (3NF).


I stuck on the first question about the candidate key. I know that the candidate keys must be a subset of (I,P,M,S,Y,L,R) since these appear on the left hand side of the Functional dependancies above and determine all of the remaining attributes. We can remove M which is determined by P, but then I was kinda confused about how to make these attributes to be the minimal, especially from complexed functional dependencies such as PMSY→LRCE. Thx for any solution and suggestions.

1

There are 1 answers

0
N. Paul On

I won't do your homework but as a hint on (a);

F:IGPMSYELRC->IGPMSYELRC

always holds. By virtue of F:P->M you can remove M and get

F:IGPSYELRC->IGPMSYELRC

now apply F:R->C to get

F:IGPSYELR->IGPMSYELRC .

Repeat this until you cannot remove any attributes from the left-hand side. Then you got a candidate key.

With different permutations of F this may yield other candidate keys.