ER Diagram
ER Diagram
<Department>
DeptID DeptName DeptZone
When an Entity is related to another Entity,
they are said to have a relationship. For
example, A Class Entity is related
to Student entity, because students study in
classes,
Depending upon the number of entities
involved, a degree is assigned to relationships.
Entities are represented by means of
rectangles. Rectangles are named with the
entity set they represent.
An entity that cannot be uniquely identified by its
own attributes and relies on the relationship with
other entity is called weak entity. The weak entity
is represented by a double rectangle.
For example – a bank account cannot be uniquely
identified without knowing the bank to which the
account belongs, so bank account is a weak entity.
Attributes are the properties of entities.
Attributes are represented by means of ellipses.
Every ellipse represents one attribute and is
directly connected to its entity (rectangle).
A key attribute can uniquely identify an entity
from an entity set. For example, student roll
number can uniquely identify a student from a
set of students. Key attribute is represented by
oval same as other attributes however the text
of key attribute is underlined.
If the attributes are composite, they are further
divided in a tree like structure. Every node is
then connected to its attribute. That is,
composite attributes are represented by ellipses
that are connected with an ellipse.
Multivalued attributes are depicted by double
ellipse
One-to-One Relationships
One-to-Many Relationships
Many to One Relationships
Many-to-Many Relationships
One-to-one − One entity from entity set A can be
associated with at most one entity of entity set B and
vice versa.
One-to-many − One entity from entity set A can be
associated with more than one entities of entity set B
however an entity from entity set B, can be associated
with at most one entity.
Many-to-one − More than one entities from entity set
A can be associated with at most one entity of entity
set B, however an entity from entity set B can be
associated with more than one entity from entity set
A.
Many-to-many − One entity from A can be
associated with more than one entity from B and vice
versa.
For them problem statement we know that,
A student can be assigned multiple courses
A Professor can deliver only one course
In the one-to-many relationship a loan is
associated with at most one customer via
borrower, a customer is associated with several
(including 0) loans via borrower
In a many-to-one relationship a loan is
associated with several (including 0) customers
via borrower, a customer is associated with at
most one loan via borrower
A customer is associated with several (possibly 0)
loans via borrower
A loan is associated with several (possibly 0)
customers via borrower