Determine Keys from Functional Dependencies

前端 未结 6 2017
野趣味
野趣味 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:28

    well, i'm no expert for this stuff, so correct me if i'm wrong, but my approach would be to eliminate impossible answers

    in this case:

    none of your FDs "gives" you B, D or F ... since those are part of the relation there can be no super key that does not contain B, D and F ... remove answer b (B is missing) ... remove answer d (F is missing)

    now let's check the remaining answers if they contain enough information to get all parts of the relation

    answer a (BCDEF) will "give" you B, C, D, E and F so you need to find A and G using the FDs ... A can be reached by BC and G can be reached by EF, so answer a is a key

    answer c (BDFG) will "give" you B, D, F and G so you need to find A, C and E using the FDs ... E can be reached by FG ... C can be reached by DE (after reaching E by FG) ... and finally A can be reached by BC (after reaching C) ...

    so answer c is some sort of key since the whole relation can be accessed this way ... but i don't know if this is enough to fit the formal definition ... if i'd have to guess, i'd say no

提交回复
热议问题