Professional Documents
Culture Documents
Session 3
Session 3
© 2017-18 KL University – The contents of this presentation are an intellectual and copyrighted property of KL University. ALL RIGHTS RESERVED 1
Agenda:
ER MODEL
Notation used in ER Diagram
Constraints
Types
© 2017-18 KL University – The contents of this presentation are an intellectual and copyrighted property of KL University. ALL RIGHTS RESERVED
E-R MODEL
• The Entity-Relationship (ER) model was originally proposed by Peter in 1976.
• The ER model is a conceptual data model that views the real world as entities and relationships.
• Entity: Any thing that may have an independent existence and about which we intend to collect
data.
Entity instance: a particular member of the entity type e.g. a particular student
© 2017-18 KL University – The contents of this presentation are an intellectual and copyrighted property of KL University. ALL RIGHTS RESERVED 3
ER Modeling -Notations
© 2017-18 KL University – The contents of this presentation are an intellectual and copyrighted property of KL University. ALL RIGHTS RESERVED 4
DOMAIN
Domain:
The set of possible values for an attribute is called the domain of the attribute.
Ex:
• The domain of attribute marital status is just the four values: single, married,
divorced, widowed.
• The domain of the attribute month is the 12 values ranging from January to
December.
© 2017-18 KL University – The contents of this presentation are an intellectual and copyrighted property of KL University. ALL RIGHTS RESERVED 5
ATTRIBUTE AND IT’S TYPES
ATTRIBUTE: It is a property or characteristic of an entity.
• Key attribute
• Multivalued attribute
• Derived attribute
© 2017-18 KL University – The contents of this presentation are an intellectual and copyrighted property of KL University. ALL RIGHTS RESERVED 6
Types of Attributes
• KEY ATTRIBUTE: The attribute (or combination of attributes) that is unique for every entity
instance.
© 2017-18 KL University – The contents of this presentation are an intellectual and copyrighted property of KL University. ALL RIGHTS RESERVED 7
• MULTIVALUED ATTRIBUTE:
An attribute having more than one value is called multivalued attribute.
Ex: skill set of an employee or hobbies of a student.
© 2017-18 KL University – The contents of this presentation are an intellectual and copyrighted property of KL University. ALL RIGHTS RESERVED 8
Examples on types of Attributes
Attributes
DOB
Name Address
© 2017-18 KL University – The contents of this presentation are an intellectual and copyrighted property of KL University. ALL RIGHTS RESERVED 9
Key attribute
DOB
Name Address
Empno Designation
Employee
© 2017-18 KL University – The contents of this presentation are an intellectual and copyrighted property of KL University. ALL RIGHTS RESERVED 10
Composite attribute
floor building
DOB
Name Address
Empno Designation
Employee
© 2017-18 KL University – The contents of this presentation are an intellectual and copyrighted property of KL University. ALL RIGHTS RESERVED 11
Multivalued Attribute
DOB
Address
Name
Designation
Empno Employee
skill set
© 2017-18 KL University – The contents of this presentation are an intellectual and copyrighted property of KL University. ALL RIGHTS RESERVED 12
Single Vs Multi-valued Attributes
• Single valued : can take on only a single value for each entity instance
E.g. age of employee. There can be only one value for this
© 2017-18 KL University – The contents of this presentation are an intellectual and copyrighted property of KL University. ALL RIGHTS RESERVED 13
Stored Vs Derived attribute
• E.g. : years of service of employee can be calculated from date of joining and
current date
© 2017-18 KL University – The contents of this presentation are an intellectual and copyrighted property of KL University. ALL RIGHTS RESERVED 14
Regular Vs. Weak entity type
• Regular Entity: Entity that has its own key attribute.
• Weak entity: Entity that depends on other entity for its existence and doesn’t have key
attribute of its own.
© 2017-18 KL University – The contents of this presentation are an intellectual and copyrighted property of KL University. ALL RIGHTS RESERVED 15
Weak entity
Empno id name
1 has N dependant
Employee
The dependent entity is represented by a double lined rectangle and the identifying
© 2017-18 KL University – The contents of this presentation are an intellectual and copyrighted property of KL University. ALL RIGHTS RESERVED 16
Cardinality
• Relationships can have different connectivity
• one-to-one (1:1)
• one-to-many (1:N)
• many-to-many (M:N)
E.g.:
© 2017-18 KL University – The contents of this presentation are an intellectual and copyrighted property of KL University. ALL RIGHTS RESERVED 17
Cardinality – One - To - One
P1 C1
P2 C2
P3 C3
P4 C4
Person Chair
One instance of entity type Person is related to one instance of the entity type Chair.
© 2017-18 KL University – The contents of this presentation are an intellectual and copyrighted property of KL University. ALL RIGHTS RESERVED 18
Cardinality – One -to- Many
E1
O1
E2
O2
E3
O3
E4
E5
Organization Employee
One instance of entity type Organization is related to multiple instances of entity type
Employee
© 2017-18 KL University – The contents of this presentation are an intellectual and copyrighted property of KL University. ALL RIGHTS RESERVED 19
Cardinality – Many-to-One
E1
D1
E2
D2
E3
D3
E4
E5
Employee Department
© 2017-18 KL University – The contents of this presentation are an intellectual and copyrighted property of KL University. ALL RIGHTS RESERVED 20
Cardinality – Many-to-Many
S1 C1
S2 C2
S3 C3
S4 C4
Student Course
Multiple instances of one Entity are related to multiple instances of another Entity.
© 2017-18 KL University – The contents of this presentation are an intellectual and copyrighted property of KL University. ALL RIGHTS RESERVED 21