Database Keys

Definition

  • Super Key : It is defined as a set of attributes within a table that can uniquely identify each record within a table

  • Candidate Key : It is defined as the minimal set of fields which can uniquely identify each record in a table

  • Primary Key : It is defined as key that can uniquely identify each record in a table

  • Composite Key : It is defined as combination of two or more attributes that uniquely identify any record in a table

  • Foreign Key : It is defined as a column or a set of columns in a table whose values correspond to the values of the primary key in another table.

Example

- Super keys : {Application_ID} , {SSN} , {Name} , {Application_ID,SSN} , {Application_ID,Name} , {Name,SSN} , {Application_ID,Name,SSN}

- Candidate keys : {Application_ID} , {SSN}

- Primary key : {SSN}

- Composite key : {Application_ID+"_"+SSN}