You are on page 1of 21

Entity Relationship Model

Entity Relationship Model

• Entity
• Attributes
• Relationships

2
ER Diagram

A Rectangle represents an entity

An ellipse represents an attribute

A Diamonds represents a relationship

A line links attributes to entity


and entity to relationship
3
MAPPING CARDINALITY/
DEGREE OF RELATIONSHIP
How one entity is associated with another entity

4
Relationship

– One : one relationship


– One-to-many relationship
– Many : One relationship
– Many : Many Relationship

5
6
7
8
9
Conversion of ERD into Tables
Rule 1: Degree of the relationship is 1:1
and both side obligatory.

If the relationship between two entities is


1:1 and both side obligatory, then
one table is necessary and the
identifier of one entity will be
posted to another
10
Conversion of ERD into Tables
Rule 1: Degree of the relationship is 1:1
and both side obligatory.

11
Conversion of ERD into Tables
Rule 2: Degree of the relationship is 1:1
and one side non-obligatory.

If the relationship between two entities is


1:1 and one side obligatory, then two
tables are necessary, one for each entity.
The identifier of non-obligatory entity will
be posted to obligatory entity.

12
Conversion of ERD into Tables
Rule 2: Degree of the relationship is 1:1
and one side non-obligatory.

13
Conversion of ERD into Tables
Rule 3: Degree of the relationship is 1:1
and both side non-obligatory.

If the relationship between two entities is


1:1 and both side non-obligatory, then
three tables are necessary, two for two
entities and one for relationship.
Identifiers of both entities will be posted
to relationship. Relationship may or may
not have descriptive attributes.
14
Conversion of ERD into Tables
Rule 3: Degree of the relationship is 1:1
and both side non-obligatory.

15
Conversion of ERD into Tables
Rule 4: Degree of the relationship is
1 : many and membership of
many side obligatory.

If the relationship between two entities is


1 : many and many side obligatory and the
other side may be obligatory or non-
obligatory, then two tables are necessary,
one for each entity. The identifier of one
side will be posted to many side.
16
Conversion of ERD into Tables
Rule 4: Degree of the relationship is
1 : many and membership of many
side obligatory.

17
Conversion of ERD into Tables
Rule 5: Degree of the relationship is 1:many
and membership of many side non-
obligatory.

If the relationship between two entities is


1:many and many side non-obligatory, and
the other side may be obligatory or non-
obligatory then three tables are necessary,
two for two entities and the other for
relationship. The identifier of both the
entities will be the attributes of the
relationship. 18
Conversion of ERD into Tables
Rule 5: Degree of the relationship is 1:many
and membership of many side non-
obligatory.

19
Conversion of ERD into Tables

Rule 6: Degree of the relationship is


many : many

If the relationship between two entities is


many : many regardless of membership
class, define three tables, one for each
entity and one for the other for
relationship.
20
Conversion of ERD into Tables
Rule 6: Degree of the relationship is
many : many

21

You might also like