Entity relationship diagram




1- Entity Relationship Model Concepts:

An entity relationship model, also called an entity-relationship (ER) diagram, is a graphical representation of entities and their relationships to each other, typically used in computing in regard to the organization of data within database or information systems. 

  • Entities:

An entity is a piece of data (an object) or concept about which data is stored. It may be an object with a physical existence – a particular person, car, house, or employee – or it may be an object with a conceptual existence – a company, a job, or a university course. The entity set which does not have sufficient attributes to form a primary key is called as Weak entity set. An entity set that has a primary key is called as Strong entity set. 

The tabular comparison between Strong Entity Set and Weak Entity Set is as follows:

                            Comparision Between Strong and Weak entity


  • Attributes:

An attribute is a property that describes an entity. For example,  the employee is the entity and employee’s name, age,  address, salary and job etc. are the attribute. 

 – Types of Attributes:
* Simple and composite:

Attributes can be classified as having many parts to them or just a single unbreakable attribute. The composite attribute is an attribute that can be subdivided into other single attributes with meanings of their own. A single attribute is just an attribute that cannot be subdivided into parts.

Comparison between simple and composite attributes


* Single-valued and multi-valued :

Attributes can be classified as single or multi-value. The single-value attribute can only have one value, while the multi-valued attributes usually can store multiple data in them.

Comparison between single and multivalued attribute

* Stored and Derived:

If an attribute’s value cannot be determined from the values of other attributes, then the attribute’s value for an entity must be kept as part of the entity and we refer to such an attribute as a Stored attribute.

A derived attribute is calculated from another attribute. The derived attribute may not be stored in the database but rather calculated using algorithm.

For example, assume we have attributes for an employee, the birth date is shown as a stored attribute and current age is shown as derived.

Comparison between stored and derived attributes


* Complex attributes:

It is formed by nesting composite attributes and multi-valued attributes in arbitrary way.

complex attributes

  • Relationships:

    An example of a relationship and its roles as a relationship “marriage” and its two roles “husband” and “wife”. A person plays the role of husband in a marriage (relationship) and another person plays the role of wife in the (same) marriage. These words are nouns. That is no surprise; naming things requires a noun.


  • Cardinality of relationships:

cardinality of relationship

  • Participation Constraint:

specifies whether the existence of an entity depends on its being related to another entity via the relationship type. Total participation constraints require the participation of every entity the relationship (displayed by double line). Also called existence dependency. Partial participation constraints (displayed by a single line).

total participant constraint

participant constraint

    • Minimum and maximum notation:


2- ER Diagram Elements:




One thought on “Entity relationship diagram

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )


Connecting to %s