Mastering Database Management

0 of 79 lessons complete (0%)

Relational Models

Entity Set and Keys

You don’t have access to this lesson

Please register or sign in to access the course content.

Key is an attribute or collection of attributes that uniquely identifies an entity among entity set. For example, the customer_id of a customer makes him/her identifiable among other customers.

Example Table Customer

1.Super Key −

A set of attributes (one or more) that collectively identifies an entity in an entity set. A superkey is a combination of columns that uniquely identifies any row within a relational database management system (RDBMS) table. A candidate key is a closely related concept where the superkey is reduced to the minimum number of columns required to uniquely identify each row.

2.Candidate Key −

candidate key is a column, or set of columns, in a table that can uniquely identify any database record without referring to any other data. Each table may have one or more candidate keys, but one candidate key is special, and it is called the primarykey. It is a minimal subset of super key.

3.Primary Key −

A primary key is one of the candidate keys chosen by the database designer to uniquely identify the entity set. A primary key’s main features are: It must contain a unique value for each row of data. It cannot contain null values.