Monday 28 August 2017

Difference between Primary key and foreign key

Primary key-

Ø  A table can have one primary key.
Ø  It cannot accept duplicate values.
Ø  It is default clustered index
Ø  It cannot accept null value

Foreign Key-

Ø  Default is Non_Clustered Index
Ø  A table can have more than one foreign key
Ø  It can accept duplicate value.
Ø  It accepts null value.
Ø  It provide link between data in two tables.

No comments:

Post a Comment

If you have any doubt, please let me know.

Popular Posts