primary key
- Can uniquely identify each row of data in the database
- The primary key must contain a unique value
- The default primary key index
- There can only be one primary key index in a table
unique key
- Establish a unique index, that is, each row of data under the index is not repeated, and is mainly established to prevent duplication of inserted data
- There can be multiple unique indexes in a table
key
- The simplest and common index is generally used to speed up the query, and the index is the same, in most cases it is used as a foreign key