A tremendous doubt assails me with the following question: does a candidate key include the primary key and in turn, if there is one, an alternative key?
Let me explain, if I have this in a table:
(attribute1,attribute2,attribute3,attribute4,attribute5)
If attribute 1 and 2 are primary keys and attributes 3 and 4 are alternate keys, does this mean that the candidate key is made up of both the primary and alternate keys?
It is that I am not clear about the relationship between candidate, primary and alternative key in a relationship.
Both the primary key and the alternate key are candidate keys. Well, a candidate key is the set of attributes that allow each row to be uniquely differentiated. And as for the alternative key, it is the candidate key that has not been selected as the primary key.
I hope it helps you, greetings.