문제

Suppose relation R(A,B,C,D) exists with no functional dependency. So what should be considered as its candidate key? Clearly any individual attribute or proper subset of all attributes cannot be a candidate key because by no means they can identify non prime attributes. So can ABCD be considered as candidate key? Or this relation will not have any candidate key?

도움이 되었습니까?

해결책

Suppose relation R(A,B,C,D) exists with no functional dependency. So can ABCD be considered as candidate key?

Yes, the key1 is comprised from all attributes together.

This is quite rare in practice, though. It mostly happens with junction/link tables that implement many-to-many (or many-to-many-to-many etc.) relationship.

Or this relation will not have any candidate key?

A relation must have at least one key, otherwise it's not a relation2.

Relation is a set, and any given object either belongs to a set or doesn't - it cannot belong multiple times (unlike for multiset). Without at least one key, the same tuple would be able to belong multiple times.


1 Just saying "key" is synonymous with "candidate key".

2 At the very least, all attributes, taken together, can be considered a key (as in your case).

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top