0

Suppose we have functional dependencies B->A, A->C defined on a relation R(A,B,C). Here B->AC (from given functional dependencies), So is B candidate key?

I read in textbooks that if a particular attribute is able to uniquely identify all attributes in a relation then it qualifies to be a candidate key. So according to that B should be a candidate key.

But if I have a table.

B A C

1 3 2

1 3 2

In this table B->AC so B should be candidate key but wikipedia (https://en.wikipedia.org/wiki/Candidate_key) says it should be unique. So is B a candidate key in this table?

I am confused.

Zephyr
  • 1,521
  • 3
  • 22
  • 42

1 Answers1

1

The reason of the confusion comes from the fact that your example is not a set, but a multiset (i.e. a collection with repeated values), while the normalization theory can be applied only to sets.

So, even if in multisets one could have functional dependencies, (and implications of functional dependencies, too), there is no concept of candidate key, that has sense only on proper sets, since it is an attribute or set of attributes that uniquely identifies all the elements of the set.

Renzo
  • 26,848
  • 5
  • 49
  • 61
  • If the second tuple would have been 1 5 6 , then will B be a candidate key? – Zephyr Dec 23 '16 at 12:18
  • @Xylene23, yes, if the two tuples are different then they form a set (that is a relation), and B is a candidate key (since it determines all the attributes of the relation). – Renzo Dec 23 '16 at 19:15
  • But in the above wikipedia link it says that the values of the attributes of the candidate key should not be same (first point) and here in 2 distinct tuples the value of B is 1 which is same – Zephyr Dec 23 '16 at 19:40
  • 1
    Sorry, I did'nt read with attention your comment. If there is a second tuple 1 5 6, then it is not true that that B → A , since for the same value of B (1), there are two different values of A (3 and 5). – Renzo Dec 23 '16 at 19:56