needing desperate help with understanding boyce codd and finding the candidate keys.
i found a link here http://djitz.com/neu-mscs/how-to-find-candidate-keys/ which i have understood for most part but i get stuck
e.g
(A B C D E F)
A B → C D E
B C D → A
B C E → A D
B D → E
right as far as i understand from the link i know you find the common sets from the left which is only B, and common sets from the right which are none
now where do i go from here? i know all candidate sets will have B in them but i need guidance on finding candidate sets after that. someone explain in simple language
The linked article isn't written particularly well. (That's an observation, not a criticism. The author's first language isn't English.) I'll try to rewrite the algorithm. This isn't me telling you how to do this. It's my interpretation of how the original author is telling you to do this.
- Identify the attributes that are on neither the left side nor right side of any FD.
- Identify the attributes that are only on the right side of any FD.
- Identify the attributes that are only on the left side of any FD.
- Combine the attributes from steps 1 and 3.
- Compute the closure of the attributes from step 4. If the closure comprises all the attributes, then the attributes from step 4 make up the only candidate key. (No matter how many candidate keys there are, every one of them must contain these attributes.)
- Identify the attributes not included in step 4 and step 2.
- Compute the closure of the attributes from step 4 plus every possible combination of attributes from step 6.
So for the FDs you posted, you'd end up with this.
- {F}
- {}
- {B}
- {BF}
- The closure of {BF} is {BF}. That's not all the attributes. (But every candidate key must contain {BF}.)
- {ACDE}
- Compute the closure of these sets of attributes.
- {ABF}
- {CBF}
- {DBF}
- {EBF}
- {ACBF}
- {ADBF}
- {AEBF}
- {CDBF}
- {CEBF}
- {DEBF}
- {ACDBF}
- {ADEBF}
- {CDEBF}
If I got those combinations right, every candidate key will be found among the possibilities in step 7. In your example, there are 3 candidate keys.
http://www.sroede.nl/projects/fdhelper.aspx
this would help'just put in ur relation and FD's
click generate at the bottom