primary key&unique

Disclaimer: This article is a blogger original article, follow the CC 4.0 BY-SA copyright agreement, reproduced, please attach the original source link and this statement.
This link: https://blog.csdn.net/qq_30757161/article/details/102763932

primary key constraint column can not be null, unique constraint column may be empty

A table can have at most one primary key, but can have multiple unique, unique can be defined as a table of multiple fields.

即:primary key = unique + not null

InnoDB storage engine will secondary index (non-primary key index) comprising a primary key index

Guess you like

Origin blog.csdn.net/qq_30757161/article/details/102763932