candidate keys from functional dependencies

后端 未结 4 1050
忘了有多久
忘了有多久 2020-12-24 06:59

Given the Relation R with attributes ABCDE. You are given the following dependencies: A -> B, BC -> E, and ED -> A. I already have the answer which is CDE, ACD, and BCD. I j

4条回答
  •  隐瞒了意图╮
    2020-12-24 07:27

    To find the candidate key you need to split the FD's into attributes into Left, Middle, Right - The Left includes attributes that only show up in the left hand side (CD) - The Middle includes attributes that show up in both left and right (ABE) - The Right includes attribues that only show up in the right hand side (none)

    Now find the closure of attributes from the Left: * CD+ -> CD Since we do not get all the attributes of the relation we need to add the Middle attributes (ABE) one at a time and try to find the closure again.

    So: * CDA+ -> CDABE (CDA is a candidate key) * CDB+ -> CDBEA (CDB is a candidate key) * CDE+ -> CDEAB (CDE is a candidate key)

提交回复
热议问题