Database Management System
Database Management System
ER diagram
An entity relationship diagram (ERD) shows
the relationships of entity sets stored in a
database. ... By defining the entities, their
attributes, and showing the relationships
between them, an ER diagram illustrates the
logical structure of databases. ER
diagrams are used to sketch out the design of
a database.
How to Draw ER Diagrams??
Why use ER Diagrams?
ER diagram
An entity relationship diagram (ERD) shows
the relationships of entity sets stored in a
database. ... By defining the entities, their
attributes, and showing the relationships
between them, an ER diagram illustrates the
logical structure of databases. ER
diagrams are used to sketch out the design of
a database.
How to Draw ER Diagrams??
Why use ER Diagrams?
Practice of ER diagram
•Writer
•Novel
•Consumer
Degree of Relationship
The degree of a relationship is the number of entity
types that participate(associate) in a relationship. By
seeing an E-R diagram, we can simply tell the degree
of a relationship i.e the number of an entity type
that is connected to a relationship is the degree of
that relationship.
For example, If we have two entity type ‘Customer’ and ‘Account’ and
they are linked using the primary key and foreign key. We can say that the
degree of relationship is 2 because here two entities are taking part in the
relationship.
Based on the number of entity types that are connected we
have the following degree of relationships:
•Unary
•Binary
•Ternary
•N-ary
Unary (degree 1)
A unary relationship exists when both the
participating entity type are the same. When
such a relationship is present we say that the
degree of relationship is 1.
For example, Suppose in a classroom, we have many students
who belong to a particular club-like dance club, basketball club
etc. and some of them are club leads. So, a particular group of
student is managed by their respective club lead. Here, the
group is formed from students and also, the club leads are
chosen from students. So, the ‘Student’ is the only entity
participating here. We can represent this relationship using the
E-R diagram as follows:
Binary (degree 2)
Cardinality → maximum
Cardinality can be 1 or Many
the symbol is placed on the
outside of the relationship line,
closest to the entity
cardinality of 1 is represented by a
straight vertical line
cardinality of Many is represented by
a “crow’s foot”
Cardinality is indicated at both
ends of the relationship line
Modality
Modality → minimum
Modality can be 1 or 0
the symbol is placed on the
inside, next to the cardinality
symbol
modality of 1 is represented by
a straight vertical line
modality of 0 is represented by
a circle
Modality is indicated at both
ends of the relationship line
from Zero to Many