Entity Relationship Diagrams Used for conceptual data modeling - part of database design Represents: the data that is important the structure of the data the relationships between different pieces of data Does NOT show process, roles, users, etc.
Basic Elements Entities people, places, things entity type is a set of things all of which have the same data properties entity instance is one concrete example of the entity type things that the system keeps track of, NOT things that are part of the system
Basic Elements (cont.) Relationships Attributes show how instances of one entity are related to instances of another entity have cardinality and degree Attributes single pieces of data that describe an instance of an entity like data elements
Basic ER Diagram SSN street name city CUSTOMER owner type Has account number ACCOUNT balance Basic ER Diagram
Composite Attribute Last Maiden Middle Title First Suffix Name CUSTOMER Composite Attribute
Multivalued Attribute Last Maiden Middle Title First Suffix Name Deductions EMPLOYEE Multivalued Attribute
Relationship with an Attribute Effective Date Fills POSITION EMPLOYEE Relationship with an Attribute
Effective Date Employment History POSITION EMPLOYEE Associative Entity
child parent person parent Unary Relationship
Ternary Relationship type training Talent name Performer Performs address Show dates location Ternary Relationship
Three Binary Relationships type training Talent name Has Used in Performer address Show dates Performs in location Three Binary Relationships
Cardinality Constraints Effective Date EMPLOYEE Fills POSITION Cardinality Constraints
A supertype and subtypes account# balance account U U savings account checking account interest rate max overdraft A supertype and subtypes
model number model number model number make price make price make price fits uses LENS CAMERA FLASH film type requires requires quantity quantity BATTERY size type
U U U model number price PHOTO EQUIPMENT make fits uses LENS CAMERA FLASH film type requires requires quantity quantity BATTERY size type
DateEnrolled DateEnrolled SSN SSN Degree STUDENT Graduation Date GRADUATE Grade TRANSCRIPT TRANSCRIPT Grade Date Date COURSE
U U Generalization DateEnrolled SSN Grade TRANSCRIPT STUDENT Date COURSE U U Degree Graduation Date FORMER CURRENT Generalization
Part of a grocery store database SUPPLIER Wastage SuppliedBy Has Ingredients ITEM Quantity Part of a grocery store database
U U U Specialization Quantity Has Ingredients ITEM BAKERY ITEM SUPPLIED ITEM SuppliedBy PERISHABLE ITEM SUPPLIER Specialization Wastage
Part of a Zoo database DOB DOB LivesIn PRIMATE HABITAT BIRD Origin Food LivesIn Origin LivesIn Food LivesIn 4-LEGGED ANIMAL REPTILE Origin Food DOB DOB Origin Food Part of a Zoo database
U U U U Specialization Origin Food DOB HABITAT LivesIn ANIMAL PRIMATE BIRD 4-LEGGED ANIMAL REPTILE Specialization
Replacing a set of subtypes with an attribute Origin Food DOB HABITAT LivesIn ANIMAL Class Replacing a set of subtypes with an attribute
Disjoint specialization model number price PHOTO EQUIPMENT make type = type d “lens” “flash” U “camera” U U fits uses LENS CAMERA FLASH film type requires requires Disjoint specialization with discriminator quantity quantity BATTERY size type
Total, disjoint specialization MOTHER Has OFFSPRING d U U BAD CHILDREN GOOD CHILDREN Total, disjoint specialization
Total, disjoint specialization with discriminator MOTHER Has SentCard OFFSPRING SentCard = d “Yes” “No” U U BAD CHILDREN GOOD CHILDREN Total, disjoint specialization with discriminator
Overlapping specialization with discriminator DateEnrolled SSN Grade TRANSCRIPT STUDENT Status Date Enrolled? Status: Graduated? COURSE o Enrolled=“Y” Graduated=“Y” U U Degree Graduation Date FORMER CURRENT Overlapping specialization with discriminator