Post on 06-Jul-2018
transcript
8/18/2019 Entity Relationship Diagram.pptx
1/17
Entity Relationship Diagram
Rani Mohanlal Assistant ProfessorDept. of CSE VAST
8/18/2019 Entity Relationship Diagram.pptx
2/17
Table of Contents
Introdution
ERD omponents
• Entity
• Attribute
• Relationship
Cardinality onstraints
• !ne " to " one
• !ne " to # many
• Many " to " one
• Many " to " many
Partiipation onstraints
• Total
• Partial
$ea% entity set
8/18/2019 Entity Relationship Diagram.pptx
3/17
ER Diagram
ERD is a tool for designing databases
Peter P. Chen proposed the ER model in &'()
Coneptual data model
*ie+s the real +orld as a set of entities and
relationships,assoiations bet+een these entities.
8/18/2019 Entity Relationship Diagram.pptx
4/17
ERD Components
Primary Components of ERD
Entity
Attribute
Relationship
8/18/2019 Entity Relationship Diagram.pptx
5/17
ERD Components Contd.
Entity
Distinguishable ob-et person/ plae/ thing/ e*ent or ob-et0 about +hih information is stored.
E1ample2" employee/ department.Entity Set2" Set of entities of same type that share same properties,attributes.
Classifiation• Physial
• Abstrat
• Independent
• Dependent
employee
department
8/18/2019 Entity Relationship Diagram.pptx
6/17
ERD Components Contd.
Attributes
Properties of entity . Eah attribute has a domain.
E1ample2" employeeemp. no./ name/ dept/ desig/ D!3/ age0
employee
emp4no
namedept
desig.
D!3
f4name l4nameDomain eg.
Age5677/78/"""/99:name5 haraterstring of length &9
Phone no
8/18/2019 Entity Relationship Diagram.pptx
7/17
Attributes Contd.
Classifiation• ;ey and
8/18/2019 Entity Relationship Diagram.pptx
8/17
ERD Components Contd.
Relationship
Assoiation among t+o or more entitiesDegree of a relationship
8/18/2019 Entity Relationship Diagram.pptx
9/17
E1ample sho+ing a binary relationship
Employee
Department $or
%s4f or
Phone
D!3
Address Dept4id
8/18/2019 Entity Relationship Diagram.pptx
10/17
Cardinality Constraints
Cardinality
Atual no. of related ourrenes for eah of the t+o entities.
Types
A 3 A 3 A 3 A 3
&"to"& &"to"Many Many"to"& Many"to"Many
8/18/2019 Entity Relationship Diagram.pptx
11/17
Cardinality E1amples&2& >
8/18/2019 Entity Relationship Diagram.pptx
12/17
Cardinality E1amples&2< >
8/18/2019 Entity Relationship Diagram.pptx
13/17
Partiipation Constraint
An entity set may partiipate in a relation either totally or partially.
• Total Partiipation2" E*ery entity of an entity type is related to someother entity set *ia a relationship type.
• Partial Partiipation2" If only fe+ members of an entity type is relatedto some other entity set *ia a relationship type.
E& E7R
Total Partial
8/18/2019 Entity Relationship Diagram.pptx
14/17
Total,partial partiipation e1amples
Professor Studentguide
8/18/2019 Entity Relationship Diagram.pptx
15/17
$ea% entity
$ea% entity2"
• an be identified uni=uely only by onsidering the primary %ey ofanother owner0 entity.
• !+ner entity set and +ea% entity set must partiipate in a one"to"many relationship set.
• $ea% entity sets must ha*e total partiipation in this identifyingrelationship set.
S $ R
!+ner entity $ea% entity
Al+ays Total
8/18/2019 Entity Relationship Diagram.pptx
16/17
$ea% entity set e1ample
CourseSetion@as
Setion
8/18/2019 Entity Relationship Diagram.pptx
17/17
E1ample
Employee
Department
Pro-et
name
emp 4no
deptD!3
+or% s4on
+or%s 4for
P4no.
P4name. budget
dep4no.dep4na
me
loation
&
<
M