Week 2
Week 2
Entity-Relationship Models
Pınar Yıldırım
Modeling data in the organization
Entity-Relationship Model
• Entities:
– Person, place, object, event
• Relationship
– Link between entities(corresponds to primary key-foreign key
equivalencies in related tables)
• Attributes
– Properties or characteristics of an entity or relationships
E-R Model
E-R Model
Entity= Employee
Modern Database Management 11th Edition, Jeffrey A. Hoffer, V. Ramesh, Heikki Topi © 2013 Pearson
Education, Inc. Publishing as Prentice Hall
Multivalued Attribute
• Multivalued may take more than one value for a given entity.
Simple Identifier
Simple and composite identifiers
• One-to-Many
– An entity on one side of the relationship can have many related
entities, but an entity on the other side will have a maximum of one
related entity
• Many-to-Many
– Entities on both sides of the relationship can have many related
entities on the other side
Cardinality of Relationships
Some Examples
E-R Examples
E-R Examples
Basic E-R Notation
Weak Entity
Enhanced E-R Diagrams
• Extends original ER model with new modeling constructs.
• Attribute inheritance
– Subtype entities inherit values of all attributes of the supertype.
Basic notation for supertype/subtype
notation
Modern Database Management 11th Edition, Jeffrey A. Hoffer, V. Ramesh, Heikki Topi © 2013 Pearson
Education, Inc. Publishing as Prentice Hall
Employee supertype with three subtypes
Modern Database Management 11th Edition, Jeffrey A. Hoffer, V. Ramesh, Heikki Topi © 2013 Pearson
Education, Inc. Publishing as Prentice Hall
Generalization and Specialization
Modern Database Management 11th Edition, Jeffrey A. Hoffer, V. Ramesh, Heikki Topi © 2013 Pearson
Education, Inc. Publishing as Prentice Hall
Example of Generalization
All these types of vehicles have common attributes.
Modern Database Management 11th Edition, Jeffrey A. Hoffer, V. Ramesh, Heikki Topi © 2013 Pearson
Education, Inc. Publishing as Prentice Hall
Example of Generalization
Modern Database Management 11th Edition, Jeffrey A. Hoffer, V. Ramesh, Heikki Topi © 2013 Pearson
Education, Inc. Publishing as Prentice Hall
Example of Specialization
Modern Database Management 11th Edition, Jeffrey A. Hoffer, V. Ramesh, Heikki Topi © 2013 Pearson
Education, Inc. Publishing as Prentice Hall
Disjoint constraint
Modern Database Management 11th Edition, Jeffrey A. Hoffer, V. Ramesh, Heikki Topi © 2013 Pearson
Education, Inc. Publishing as Prentice Hall
Disjoint constraint
Overlapping
Modern Database Management 11th Edition, Jeffrey A. Hoffer, V. Ramesh, Heikki Topi © 2013 Pearson
Education, Inc. Publishing as Prentice Hall
Overlapping
References
• Modern Database Management 11th Edition, Jeffrey A. Hoffer, V. Ramesh, Heikki
Topi © 2013 Pearson Education, Inc. Publishing as Prentice Hall
• https://www.tutorialspoint.com/dbms/er_diagram_representation.htm