ER Diagram Notes (SQL)
ER Diagram Notes (SQL)
C Practices
Dixith S N 1
C 1976 proposed by Peter Chen
C ER diagram is widely used in database design
◦ Represent conceptual level of a database system
◦ Describe things and their relationships in high level
Dixith S N 2
C Entity set – an abstraction of similar things,
e.g. cars, students
◦ An entity set contains many entities
C Attributes: common properties of the entities
in a entity sets
C Relationship – specify the relations among
entities from two or more entity sets
Dixith S N 3
Dixith S N 4
C A relationship may be thought as a set as well
◦ For binary relationship, it enumerates the pairs of
entities that relate to each other
◦ For example, entity set Male = {Suresh,
Ramesh, Sylesh} entity set Female = {Rita,
Rina, Karina}. The relationship set Married
between Male and Female may be
{<Suresh, Rina>, <Ramesh, Karina>}
Dixith S N 5
Participation:
1. Maximum Participation:
It determines the maximum number of times an entity participate in a relationship.
i.e. (max. no of times a record in a table participate in a relationship with a record in another table)
2. Minimum Participation:
It determines the minimum number of time an entity can participate in a relationship.
NOTE:
If the minimum participation is 1 or greater than one then it becomes total participation.
If the minimum participation in 0 then it becomes partial participation.
CARDINALITY:
Dixith S N 6
Dixith S N 7
Dixith S N 8
C The degree of a relationship = the number of
entity sets that participate in the relationship
◦ Mostly binary relationships
◦ Sometimes more
C Mapping cardinality of a relationship
◦ 1 –1
◦ 1 – many
◦ many – 1
◦ Many-many
12
13
14
13
14
15
C Both many and 1 include 0
◦ Meaning some entity may not participate in the
relationship
16
• When we require all entities to participate in the relationship
(total participation), we use double lines to specify
17
C Sometimes entities in a entity set may relate
to other entities in the same set. Thus self
relationship
C Here employees mange some other
employees
C The labels “manger” and “worker” are called
roles the self relationship
18
MAPPING OF ER-DIAGRAM: