Difference between primary key and unique index

  1. A primary key is a constraint; a unique index is an index
  2. After the primary key is created, it must contain a unique index; but the unique index is not necessarily the primary key
  3. Primary keys do not allow nulls; unique indexes do

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=325483457&siteId=291194637