Types Of Database Keys

 ♣A primary key:
is a field in a table which is unique and enables you to identify
every record in that table.

♣ A foreign key:
 is used to link tables together and create a relationship / it is a
field in one table that is linked to the primary key in another table.

♣ A compound key:
  is a primary key that combines more than one foreign key to make a unique value.

♣COMPOUND KEY:
 has two or more attributes that allow you to uniquely recognize a specific record. It is possible that each column may not be unique by itself within the database. However, when combined with the other column or columns the combination of composite keys become unique. The purpose of the compound key in database is to uniquely identify each record in the tabl

♣COMPOSITE KEY:
 is a combination of two or more columns that uniquely identify rows in a table. The combination of columns guarantees uniqueness, though individually uniqueness is not guaranteed. Hence, they are combined to uniquely identify records in a table.
The difference between compound and the composite key is that any part of the compound key can be a foreign key, but the composite key may or maybe not a part of the foreign key.

Comments