Question

In my database class we practiced how to find the candidate keys, given the functional dependencies. However they were easy examples, based on a single attribute being functionally dependent on a single attribute but in our book it gives the following example of more complex functional dependencies. Let's say that I have the following relationship:

$$R(A,B,C,D,E,F)$$

with the following functional dependencies:

$$f_1: \{A,B,C\} \to \{D,F\}$$ $$f_2: \{D,E,F\} \to \{A,C,E\}$$ $$f_3: \{D\} \to \{B\}$$

and I need to find all the candidate keys. Because we need at least $3$ of the attributes to make candidate keys. Through writing out each of the tuples made up of $3$ or more attributes, I found that $\{A, D,E,F\}$, $\{A,B,C,E\}$, $\{D,E,F\}$ and $\{A,C,D,E\}$ are all candidate keys. However the catch is that either $\{A, D,E,F\}$, $\{A,B,C,E\}$ or $\{D,E,F\}$,$\{A,C,D,E\}$, $\{A,B,C,E\}$ are the candidate keys.

I think that because the definition of a candidate key is that there can't be a subset of it that's also a candidate key. Using this logic, $\{A, D,E,F\}$ would also not be candidate key as $\{D,E,F\}$ is already a candidate key. Therefore, the final candidate keys would be:

$$\{D,E,F\},\{A,C,D,E\}, \{A,B,C,E\}$$

Is my understanding of the topic correct or have I gone of the rails?

No correct solution

Licensed under: CC-BY-SA with attribution
Not affiliated with cs.stackexchange
scroll top