What is Entity Relationship Model (ERM)?
Here is the answer of the most common question i.e. what is Entity Relationship Model. Entity Relationship Model (ER Model) is a graphical approach to database design. It uses Entity/Relationship to represent real world objects.
An ER model is a design or blueprint of a database that can later be implemented as a database.
The main components of ER diagram are:
- Entity set
- Relationship set
What is an ER diagram?
It shows the relationships between different entity sets. An entity set can be defined as the group of similar entities that have attributes. ER diagram shows the complete logical structure of the database. We can understand it better by the help of an example.
What better example than a student and a college
- In this diagram we have two entities Student and College.
- The relationship in this is Many to One as a college can have many students but a student cannot study in different colleges at the same time.
- St_Addr, St_ID and C_Id are their attributes.
Components of ER Diagram
There are three components of ER diagram:
An entity is an object or component of data. It is represented by a rectangle in ER diagram. Eg.
An attribute describes the property of an entity. It is represented as on oval shape. It is of four types:
- St_Id is the key attribute as it uniquely identifies a student.
- St_Addr is the Composite attribute as it is composed of other attributes.
- St_Phone is the multivalued attribute as a student can have multiple phone numbers.
- St_Age is Derived attributes as the age of the student is always changing.
Relationship is represented by the diamond shape in ER diagram. It shows the relationships among entities. It is of four types:
- One to One
- One to Many
- Many to One
- Many to Many