8 Entity–relationship data modelling
8.1 Introduction
One type of data model is an entity–relationship data model.
Experience has shown that data can be best described by relationships between entities. An entity is anything of interest about which data is recorded, such as roads, weather stations, trucks and weather station readings in the IceBreaker project in the book MRP. In general, there will be many relationships (or associations) linking the entities. A trivial example is the fact that a given weather reading is associated with a specific weather station. The significant point is that relationships are just as much a part of the system data as are the entities. It is often useful to store characteristics of the entities. For example, a particular type of weather station transmits its signal every minute, or a specific truck has a particular capacity for the amount of gritting material it can carry.
Many different kinds of relationship between entities have been identified, and there are many different ways of representing those relationships. Diagrams are often used to show relationships, but there are other techniques.
Data modelling, that is, the production of a data model is a ‘formal’ representation of what data the product needs, expressed in terms that are independent of how it may be realised in software. Entity–relationship (E–R) data modelling is a particular kind of modelling that expresses data requirements in terms of entity types, attributes of entity types and relationships between entity types. It is a widely used modelling technique which is effective for displaying the important elements of a data model for human understanding and communication. However, it is only one of a number of modelling techniques available. We shall use an example to illustrate E–R data modelling.