What's wrong with nullable columns in composite primary keys?

后端 未结 6 1050
囚心锁ツ
囚心锁ツ 2020-11-27 12:57

ORACLE does not permit NULL values in any of the columns that comprise a primary key. It appears that the same is true of most other \"enterprise-level\" systems.

At

6条回答
  •  孤街浪徒
    2020-11-27 13:16

    A primary key defines a unique identifier for every row in a table: when a table has a primary key, you have a guranteed way to select any row from it.

    A unique constraint does not necessarily identify every row; it just specifies that if a row has values in its columns, then they must be unique. This is not sufficient to uniquely identify every row, which is what a primary key must do.

提交回复
热议问题