Please disable adblock to view this page.

← Go home

Types of keys in E-R modeling

key-e-r-modeling

September 17, 2016
Published By : Pratik Kataria
Categorised in:

key-e-r-modeling

  1. Super key: Allows us to identify uniquely an entity in the entity set. Example: Roll_No attribute of student distinguishes student entity from another.
  2. Candidate key: A superkey for which no subset is a superkey. Example: Roll_No and {Student_Name, Student_street}  are candidate keys
  3. Primary key: It is a candidate key that is chosen by the database designer as the principle means of identifying entities within an entity set. Example: Address field should not be a primary key whereas Social Security Number can be a primary key.
  4. Foreign key: An attribute or set of attributes, within one relation that matches the candidate key of some relation. Example: Branch_no in Branch table is primary key. Branch_no in Staff table is foreign key that connects to Branch table.
Pratik Kataria is a budding programmer, web designer and developer.