Database Normalisation Questions Medium
In database normalization, a candidate key is a minimal set of attributes that can uniquely identify a tuple (row) in a relation (table). It means that no subset of the candidate key can uniquely identify a tuple. In other words, if any attribute is removed from the candidate key, it will no longer be able to uniquely identify a tuple.
On the other hand, a superkey is a set of attributes that can uniquely identify a tuple in a relation. Unlike a candidate key, a superkey may contain additional attributes that are not necessary for uniqueness. In other words, a superkey can have redundant attributes that do not contribute to the uniqueness of a tuple.
To summarize, the main difference between a candidate key and a superkey is that a candidate key is a minimal set of attributes that uniquely identifies a tuple, while a superkey is a set of attributes that can uniquely identify a tuple but may contain redundant attributes.