Keys

In this lesson, we discuss the basics of keys and how they are represented using ER diagrams.

Key attributes of an entity type

An important constraint on the entities of an entity type is the key or uniqueness constraint on attributes. An entity type usually has one or more attributes whose values are distinct for each individual entity in the entity set. Such an attribute is called a key attribute, and its values can be used to identify each entity uniquely. For the EMPLOYEE entity type, a typical key attribute is Ssn (Social Security number) as each person has a unique social security number.

In an ER diagram, each key attribute has its name underlined inside the oval, as illustrated in the figure below:

Get hands-on with 1200+ tech skills courses.