2,631 views
4 votes
4 votes
Can we allow NULL value in some attribute of primary key, if primary key contains more than one attribute?

2 Answers

3 votes
3 votes

Entity Integrity

Entity Integrity is the mechanism the system provides to maintain primary keys. The primary key serves as a unique identifier for rows in the table. Entity Integrity ensures two properties for primary keys:

  • The primary key for a row is unique; it does not match the primary key of any other row in the table.
  • The primary key is not null, no component of the primary key may be set to null.
    http://www.firstsql.com/frefer2.htm
0 votes
0 votes
  • ORACLE does not permit NULL values in any of the columns that comprise aprimary key. It appears that the same is true of most other "enterprise-level" systems. At the same time, most systems also allow unique contraints on nullable columns.

In Oracle, you can’t have null values in Composite primary key columns. I’m not sure about MySQL , SQL server,..

i read somewhere in oracle forums that even if you declare columns which you want to make as composite primary key as nullable. when you are adding primary key constraint, the columns would become not null columns.

Related questions

1 votes
1 votes
1 answer
1
radha gogia asked Oct 2, 2015
375 views
According to me both ER1 and ER2 have a many to one relation from P To Q , so does it imply that P has more no of entities than Q or we can simply say that through an ER ...
0 votes
0 votes
0 answers
3
0 votes
0 votes
0 answers
4
tanwardivya asked Jan 11, 2017
214 views