ER Model and Shopping Cart Example

The Entity-Relationship approach is a standard modeling technique for the data aspects of an application. It was introduced by Peter Chen in 1976 [1]. The model is usually the base for an implementation in a relational database, but it is not concerned with implementation details such as data types. It contains several basic concepts:

It is the task of the analyst to employ careful questioning of key users in order to reveal entities and relationships. Assume that in a simple shopping cart application the following entities and their relationships have been identified:

The corresponding diagram is shown below. This is not the only solution, as the ITEM entity could also be understood as an n:m relationship between order and product. However, to facilitate the transition to the physical implementation such relationships are usually resolved into 1:n relationships by introducing additional entities, such as ITEM in this example.


[1] Peter Chen (1976). "The Entity-Relationship Model - Toward a Unified View of Data". ACM Transactions on Database Systems 1 (1): 9-36.