David M. Kroenke’s, th 10 ed. Database Processing: Fundamentals, Design, and Implementation Chapter Five: Data Modeling with the Entity-Relationship Model Part One B DAVID M. KROENKE’S DATABASE PROCESSING, 10th Edition © 2006 Pearson Prentice Hall, modified by Dr. Lyn Mathis 5-1 Data Modeling Notation (a) and (b) NOT Equivalent Statements DAVID M. KROENKE’S DATABASE PROCESSING, 10th Edition © 2006 Pearson Prentice Hall, modified by Dr. Lyn Mathis 5-2 Data Modeling Notation: ERwin DAVID M. KROENKE’S DATABASE PROCESSING, 10th Edition © 2006 Pearson Prentice Hall, modified by Dr. Lyn Mathis 5-3 Data Modeling Notation: N:M and O-M Note that: ERwin cannot indicate true minimum cardinalities on N:M relationships Hand-draw the minimum cardinality symbol DAVID M. KROENKE’S DATABASE PROCESSING, 10th Edition © 2006 Pearson Prentice Hall, modified by Dr. Lyn Mathis 5-4 ID-Dependent Entities • • • • Always a child entity Parent must exist first Identifier includes the identifier of parent The minimum cardinality – from the ID-dependent entity – to the parent is always one. DAVID M. KROENKE’S DATABASE PROCESSING, 10th Edition © 2006 Pearson Prentice Hall, modified by Dr. Lyn Mathis 5-5 ID-Dependent Entities: Logical Dependence on Parent A solid line indicates an identifying relationship DAVID M. KROENKE’S DATABASE PROCESSING, 10th Edition © 2006 Pearson Prentice Hall, modified by Dr. Lyn Mathis 5-6 ID-Dependent Entities: Important Features in Template • • • • • • • Solid relationship line 1:M relationship Hash mark by parent, always Child often optional, but not always Identifier of parent part of identifier of child Parent symbol has sharp corners Child symbol has rounded corners DAVID M. KROENKE’S DATABASE PROCESSING, 10th Edition © 2006 Pearson Prentice Hall, modified by Dr. Lyn Mathis 5-7 Weak Entities • Existence depends upon another entity • All ID-Dependent entities • Other non-ID-dependent weak entities (identifier of the parent not part of the identifier of the weak child entity) DAVID M. KROENKE’S DATABASE PROCESSING, 10th Edition © 2006 Pearson Prentice Hall, modified by Dr. Lyn Mathis 5-8 Non-Identifying Weak Entities A dashed line indicates a nonidentifying relationship DAVID M. KROENKE’S DATABASE PROCESSING, 10th Edition © 2006 Pearson Prentice Hall, modified by Dr. Lyn Mathis Weak entities must be indicated by an accompanying text box in Erwin – There is no specific notation for a nonidentifying but weak entity relationship 5-9 Non-Identifying Weak Entities • • • • • Dashed line between parent & child Hash mark by parent Parent always required Child often optional, but not always In Erwin, rounded corners not possible – For weak entity (child) – Technically, should be rounded DAVID M. KROENKE’S DATABASE PROCESSING, 10th Edition © 2006 Pearson Prentice Hall, modified by Dr. Lyn Mathis 5-10 Subtype Entities • A special case of a supertype entity • Supertype contains all common attributes • Subtypes contain specific attributes. • Discriminator attribute possible – In supertype – Indicates the subtype. DAVID M. KROENKE’S DATABASE PROCESSING, 10th Edition © 2006 Pearson Prentice Hall, modified by Dr. Lyn Mathis 5-11 Mutually Exclusive Subtype Example ssn FACULTY Division Rank EMPLOYEE name 1 HOURLY program title Salary vacation address SALARIED title wage DAVID M. KROENKE’S DATABASE PROCESSING, 10th Edition © 2006 Pearson Prentice Hall, modified by Dr. Lyn Mathis salary 5-12 Inclusive Subtype Example ID PERSON name m address CUSTOMER EMPLOYEE pay rate credit limit title DAVID M. KROENKE’S DATABASE PROCESSING, 10th Edition © 2006 Pearson Prentice Hall, modified by Dr. Lyn Mathis charge card no 5-13 Subtypes – represent entities with optional sets of attributes • Inheritance • Not always mutually exclusive DAVID M. KROENKE’S DATABASE PROCESSING, 10th Edition © 2006 Pearson Prentice Hall, modified by Dr. Lyn Mathis 5-14 Subtypes with a Discriminator DAVID M. KROENKE’S DATABASE PROCESSING, 10th Edition © 2006 Pearson Prentice Hall, modified by Dr. Lyn Mathis 5-15 Subtypes: Exclusive or Inclusive • Exclusive, one supertype relates to at most one subtype. • Inclusive, one supertype can relate to one or more subtypes. DAVID M. KROENKE’S DATABASE PROCESSING, 10th Edition © 2006 Pearson Prentice Hall, modified by Dr. Lyn Mathis 5-16 Subtypes: Exclusive or Inclusive (Continued) DAVID M. KROENKE’S DATABASE PROCESSING, 10th Edition © 2006 Pearson Prentice Hall, modified by Dr. Lyn Mathis 5-17 Subtypes: IS-A relationships • Called IS-A relationships • Subtype IS A supertype • Identifer of the supertype and all of its subtypes must be identical • Subtypes avoid value-inappropriate nulls. DAVID M. KROENKE’S DATABASE PROCESSING, 10th Edition © 2006 Pearson Prentice Hall, modified by Dr. Lyn Mathis 5-18 ERwin Symbol Summary DAVID M. KROENKE’S DATABASE PROCESSING, 10th Edition © 2006 Pearson Prentice Hall, modified by Dr. Lyn Mathis 5-19 ERwin Symbol Summary (Continued) DAVID M. KROENKE’S DATABASE PROCESSING, 10th Edition © 2006 Pearson Prentice Hall, modified by Dr. Lyn Mathis 5-20 David M. Kroenke’s Database Processing Fundamentals, Design, and Implementation (10th Edition) End of Presentation: Chapter Five Part One B DAVID M. KROENKE’S DATABASE PROCESSING, 10th Edition © 2006 Pearson Prentice Hall, modified by Dr. Lyn Mathis 5-21