Determine Keys from Functional Dependencies

前端 未结 6 1968
野趣味
野趣味 2020-12-22 23:43

I\'m taking a database theory course, and it\'s not clear to me after doing the reading how I can infer keys, given a set of functional dependencies.

I have an examp

6条回答
  •  温柔的废话
    2020-12-23 00:31

    step1: since AB->C and CD->E.  then we get ABD->ABCDE(1)
    step2: Given (1) and EF->G, then we get ABDF->ABCDEF, then ABDF->ABCDEFG(2), 
    

    so ABDF is a super Key. Then we will use the result of the depnedencies to determine whether they are keys. (here why I use BC->A, because A is part of my superkey, which is dependent on BC).

    step3: Given (2) and BC->A, we get BCDF->ABDF, so BCDF->ABCDEFG(3)   
    step4: Given (3) and DE->C, we get BDEF->BCDE, so BDEF->ABCDEFG(4)   
    step5: Given (4) and FG->E, we get BDFG->BDEF, so BDFG->ABCDEFG,    
    So the Answer BDFG is right.
    

提交回复
热议问题