Differentiate between Primary key and Foreign key

Primary KeyForeign Key
It identifies the each record in a table uniquely.It maintains the relation between two tables. A foreign key is primary key in another related table.
A table can have only one Primary key.A table can have more than one Foreign key.
Primary key cannot have NULL values.Foreign key can have NULL values.

Leave a Comment

Your email address will not be published. Required fields are marked *

error: Content is protected !!