The Entity-Relationship Model

Read this chapter and pay attention to the main concepts, kinds of entities, types of attributes, and types of keys. Take notes on the three relationship types and complete the exercise at the end of the chapter.

Entity, Entity Set and Entity Type

An entity is an object in the real world with an independent existence that can be differentiated from other objects. An entity might be

  • An object with physical existence (e.g., a lecturer, a student, a car)
  • An object with conceptual existence (e.g., a course, a job, a position)

Entities can be classified based on their strength. An entity is considered weak if its tables are existence dependent.

  • That is, it cannot exist without a relationship with another entity
  • Its primary key is derived from the primary key of the parent entity
    • The Spouse table, in the COMPANY database, is a weak entity because its primary key is dependent on the Employee table. Without a corresponding employee record, the spouse record would not exist.

An entity is considered strong if it can exist apart from all of its related entities.

  • Kernels are strong entities.
  • A table without a foreign key or a table that contains a foreign key that can contain nulls is a strong entity

Another term to know is entity type which defines a collection of similar entities.

An entity set is a collection of entities of an entity type at a particular point of time. In an entity relationship diagram (ERD), an entity type is represented by a name in a box. For example, in Figure 8.1, the entity type is EMPLOYEE.

Figure 8.1. ERD with entity type EMPLOYEE.


Existence dependency

An entity's existence is dependent on the existence of the related entity. It is existence-dependent if it has a mandatory foreign key (i.e., a foreign key attribute that cannot be null). For example, in the COMPANY database, a Spouse entity is existence -dependent on the Employee entity.