Primary VS Foreign Key

Foreign Key :-

  1. Foreign key is a column or group of columns in a relational database table that provides an association between data in two tables.

  2. Foreign key accepts NULL value.

  3. Table can have multiple foreign keys.

  4. Tuples can have a duplicate value for a foreign key attribute.

Primary Key :-

  1. Primary key is a special relational database table column or a combination of multiple columns that allows to uniquely identify all table records.

  2. Primary key value cannot be NULL and its a Unique.

  3. Table can have only one primary key.

  4. Two tuples in a relation cannot have duplicate values for a primary key attribute.