Entities and Relationships

This chapter examines the relationship between the elements of a database environment. An entity is something about which data is stored. It may or may not be tangible. Entities have data that describe them (attributes). The formal term for expressing data relationships is a data model. This chapter deals with the relational data model. The purpose for putting the data that describe an entity into a database is to retrieve the data at some later date. Therefore, there must be some way of distinguishing one entity from another so that one can always be certain that one is retrieving the precise entity required. This is done by ensuring that each entity has some attribute values that distinguish it from every other entity in the database (an entity identifier). There are three basic types of relationships between various entities—one-to-one (1:1), one-to-many (1:M), and many-to-many (M:N or M:M). As far as the documentation of these relationships is concerned, the Chen and UML methods of drawing entity relationship diagrams have very different ways of representing relationships, each of which has its advantages in terms of the amount of information it provides and its complexity. Exactly what is the “correct” design for a specific business depends on the business rules; what is correct for one organization may not be correct for another. This is not a matter of a correct or incorrect database design but of how the business operates.