An entity relationship diagram
An entity relationship diagram is an abstract that is used to represent data in databases. Entity relationship model is a database modeling technique that is used to produce different schemas of a database. It is used to produce conceptual schema and semantic schema. It is also used to produce a relational model using a top down approach. An entity diagram creates a graphical representation of the entities, and the relationship between entities. An entity diagram is made up of several components (Hoffer, Prescott & McFadden, 2007). That is the entities, the relationship and the cardinality. An entity in an entity relationship diagram can be a person, a place or any event. Database designers collect data representing the entities in the entity diagram. Entities in an entity diagram are presented using a rectangle. In addition, the entities are labeled using singular noun. Examples of entities include inventory, and vendors.
Entities are used to represent tables in a diagram. The data base designer can use the inventory and vendor entities to construct tables in the database. Another component in an entity diagram is the relationship (Hoffer, Prescott & McFadden, 2007). A relationship is said to be the interaction between entities in a database. For example, a vendor can supply goods, and can have one inventory. In the diagram the relationship between the vendor and inventory is one to many. This means one inventory can be owned by many vendors. The relationship is defined by the word “supplies”. A relationship is shown by a diamond shape or a single line connecting the entities. The relationships should be labeled using a verb (Hoffer, Prescott & McFadden, 2007). Cardinality is used to show the relationship between two or more entities in terms of numbers. The cardinality of an entity can be zero, one or many.
There are various types of cardinalities used to represent relationship between entities. For example, a relationship can be a one to one mapping, one to many mapping or many to many mapping (Hoffer, Prescott & McFadden, 2007). The database designer should specify the type of mapping used in developing a database. An entity diagram is useful as it helps one map entities in the real world in a database. This is done by identifying the entities from user requirements and showing the relationship between the entities, and their mappings. An entity diagram helps in database design as it gives visual representation of the entities (Hoffer, Prescott & McFadden, 2007). For example, in accompany where there are vendors and invoices, the database designer will use the two entities to model a logical database, then a physical database to represent the entities. The designer will use the various stages of database development to construct a database using the entities. That is the logical design, physical design, and implementation. In logical design, the designer uses flow diagrams to show the relationship. In physical design, the designer constructs the diagram using the user requirements (Hoffer, Prescott & McFadden, 2007).
When representing entities in an entity relationship diagram, the designer uses the three components. The designer uses relationships to show the interaction between two entities in an entity relationship diagram. The relationships between the entities are shown using arrows, and lines (Hoffer, Prescott & McFadden, 2007). The origin of the arrow indicates the parent in one to one mapping. The destination of the arrow represents the child. In many to many relationships, the single entity represents the parent and the other entities represent the children. Multiple relationships are shown by multiple lines connecting the entities (Hoffer, Prescott & McFadden, 2007). Recursive relationships are common in an ERD diagram and they are shown by drawing a relationship line that begins and ends connected to the same entity. After identifying the relationship between the entities, the designer has to indicate the cardinality of the entities. The cardinality of an entity is used to show relationship between entities. The cardinality of entities differs from one entity relationship diagram to another. For example, an entity diagram can have one to one or one to many or many to many. The cardinalities have different meanings and they are presented differently. In one to one, the designer uses an arrow that originates from one entity to another (Hoffer, Prescott & McFadden, 2007).
The origin of the entity is the parent and the destination is the child. In one to many mapping, it means that there are many children and one parent. The single entity in the relationship diagram is the parent and the other entities are considered to be children (Hoffer, Prescott & McFadden, 2007). For example, in the vendor and invoice diagram, the cardinality is one to many. The cardinality and the arrows are used to show the relationship between entities. Symbols at the end of a relationship line indicate the cardinality and optionality of the relationship. Optionality is used to indicate whether a relationship is optional or mandatory. Cardinality shows the maximum number of relationships in an entity diagram. A circle is used to show an optional relation. It is often thought to be aero. A stroke shows a mandatory relationship. Entities in an entity relationship diagram are shown using boxes. An entity subtype is depicted using smaller boxes that are shown within larger boxes. Entity subtypes are used to show relationship that apply to a large class or small class (Hoffer, Prescott & McFadden, 2007).
Hoffer, J. A., Prescott, M. B, & McFadden, F.R . (2007).Modern Database Management. Edition8. Upper Saddle River, NJ. Pearson Prentice Hall