Super key: the attribute set that uniquely identifies a tuples in a link is called the super key of the link mode.
Candidate Key: A super key without redundant attributes is called a candidate key.
Primary Key (primary key): A candidate key selected as a tuplesProgramPrimary Key
For example, if there is no duplicate name for all people in a small range, consider the following attributes:
ID Card Name gender age
The ID card is unique, so it is a super key
The name is unique, so it is a super key
(Name, gender) is unique, so it is a super key
(Name, gender, age) is unique, so it is a superkey
-- It can be seen that the combination of superkeys is unique, but it may not be the smallest and unique
The ID card is unique and has no redundant attributes. Therefore, it is a candidate key.
The name is unique and has no redundant attributes. Therefore, it is a candidate key.
-- We can see that the candidate key is a super key without any redundant attributes.
To facilitate input query, you can select the ID card as the primary key.
You can also select the name as the primary key.
-- The primary key is a selected candidate key.