What is difference between unique key with 'not null' constraint and primary key?

后端 未结 4 1161
深忆病人
深忆病人 2020-12-31 11:02

I want to know difference between these two key.

When the Unique key with not null constrain in terms of how they are stored in database

and wh

4条回答
  •  没有蜡笔的小新
    2020-12-31 11:53

    A primary key must be unique and non-null, so they're the same from that standpoint. However, a table can only have one primary key, while you can have multiple unique non-null keys.

    Most systems also use metadata to tag primary keys separately so that they can be identified by designers, etc.

    What are the differences between a primary key and a Unique key with not null constrain in terms of how they are stored in database

    If both are either CLUSTERED or NON CLUSTERED then the only difference is metadata in most systems to tag a index as a PK.

    what difference are there when we making Select,Insert,Update, Delete operation for these keys

    None.

提交回复
热议问题