Components of ER Diagram: Entity
Components of ER Diagram: Entity
Components of ER Diagram: Entity
In ER Model, we disintegrate data into entities, attributes and setup relationships between
entities, all this can be represented visually using the ER diagram.
For example, in the below diagram, anyone can see and understand what the diagram wants
to convey: Developer develops a website, whereas a Visitor visits a website.
Components of ER Diagram
Entitiy, Attributes, Relationships etc form the components of ER Diagram and there are
defined symbols and shapes to represent each one of them.
Entity
Weak Entity
To represent a Key attribute, the attribute name inside the Ellipse is underlined.
Derived attributes are those which are derived based on other attributes, for example, age can
be derived from date of birth.
To represent a derived attribute, another dotted ellipse is created inside the main ellipse.
Double Ellipse, one inside another, represents the attribute which can have multiple values.
ER Diagram: Entity
An Entity can be any object, place, person or class. In ER Diagram, an entity is represented
using rectangles. Consider an example of an Organisation- Employee, Manager, Department,
Product and many more can be taken as entities in an Organisation.
The yellow rhombus in between represents a relationship.
Weak entity is an entity that depends on another entity. Weak entity doesn't have anay key
attribute of its own. Double rectangle is used to represent a weak entity.
ER Diagram: Attribute
Key attribute represents the main characterstic of an Entity. It is used to represent a Primary
key. Ellipse with the text underlined, represents Key Attribute.
An attribute can also have their own attributes. These attributes are known as Composite
attributes.
ER Diagram: Relationship
A Relationship describes relation between entities. Relationship is represented using
diamonds or rhombus.
1. Binary Relationship
2. Recursive Relationship
3. Ternary Relationship
Binary Relationship means relation between two Entities. This is further divided into three
types.
The above example describes that one student can enroll only for one course and a course
will also have only one Student. This is not what you will usually see in real-world
relationships.
The below example showcases this relationship, which means that 1 student can opt for many
courses, but a course can only have 1 student. Sounds weird! This is how it is.
It reflects business rule that many entities can be associated with just one entity. For example,
Student enrolls for only one Course but a Course can have many Students.
Many to Many Relationship
The above diagram represents that one student can enroll for more than one courses. And a
course can have more than 1 student enrolled in it.