Difference between primary key and foreign key

 

Difference between Primary key and Foreign Key
 

Primary Key

Foreign Key

Primary key can not be NULL

Foreign key can be NULL
   

Primary keys enforce entity integrity by uniquely identifying entity instances

Foreign keys enforce referential integrity by completing an association between two entities

   

No comments:

Post a Comment