on Leave a Comment

Entity Relationship Diagram Tutorial

ER diagram is entity relationship diagram. ER diagram represents relationship between entities and attributes.

Entities: Any real world object is called entity. Example of real world object is student, employee, customer etc. Entities can be either animate or inanimate.

Entity set: Entity set is a collection of entities of same type. For example, records of students in a class.

Entity instance: A specific individual entity in an entity set. For example, a particular student in a class.

Key attributes in entity: An attribute having unique value for entities in an entity set is key attribute. For example, roll no (attribute) is unique for every student (entity) in a class.

Weak type entity: An entity that has no key attributes is known as weak type entity. Weak type entity is also known as child or subordinate entity type. For example, a person with attributes name, gender and age has no key attribute. Name, gender and age of two people can be same.

Strong type entity: An entity having key attributes is known as strong type entity. Strong type entity is also known as regular entity. For example, student with roll no attribute is strong type entity. Roll no of two student cannot be same.

Relationship

In ER diagram, relationship is represented as diamond symbol. Entity is represented as rectangle symbol and attribute is represented as ellipse or oval symbol. Link between entities and attribute is represented by a line.

Binary relationship

Binary relationship represents relationship between entities.
Suppose entity A and entity B
One to one

Only one instance of entity A can be associated with only one instance of entity B.

er diagram relationship one to one


One to many

Only one instance of entity A can be associated with many instances of entity B.
er diagram relationship one to many


Many to one

Many instances of entity A can be associated with only one instance of entity B.
er diagram relationship many to one


Many to many

Many instances of entity A can be associated with many instances of entity B.
er diagram relationship many to many

0 comments:

Post a Comment