1 / 18

Chapter 9

Relational Database Design by ER- and EER-to-Relational Mapping . Chapter 9. Lecture # 20 August 4 ,2012. Review of ER-to-Relational Mapping Algorithm. We present the concepts of a general mapping algorithm Algorithm has 7 steps: Step 1: Mapping of regular (strong) entity types

dotty
Download Presentation

Chapter 9

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Relational Database Design by ER- and EER-to-Relational Mapping Chapter 9 Lecture # 20 August 4 ,2012

  2. Review of ER-to-Relational Mapping Algorithm • We present the concepts of a general mapping algorithm • Algorithm has 7 steps: • Step 1: Mapping of regular (strong) entity types • Step 2: Mapping of weak (dependent) entity types • Steps 3, 4, 5: Mapping of binary relationship types of different cardinality ratios (1:1, 1:N, M:N) • Step 6: Mapping of multi-valued attributes • Step 7: Mapping of n-ary relationship types, n > 2 • Example: We use the COMPANY ER schema diagram (Figure 9.1, next slide) to illustrate the mapping steps • Additional steps (Steps 8, 9) for mapping EER model constructs (specialization/generalization, UNION types) presented later

  3. EER To Relational MappingsMapping of Specialization or Generalization • Step 8: Options for Mapping Specialization or Generalization. • Option 8A: Multiple relations—superclass and subclasses. • Option 8B: Multiple relations—subclass relations only. • Option 8C: Single relation with one type attribute. • Option 8D: Single relation with multiple type attributes.

  4. EER To Relational MappingsMapping of Specialization or Generalization • Step 8: Options for Mapping Specialization or Generalization. • Option 8A: Suitable for Total, Partial Disjoint or Overlapping • Option 8B: Recommended only for disjoint • Option 8C: Works only for disjoint • Option 8D:Works for specializations whose subclasses are overlapping.

  5. EER To Relational MappingsMapping of Specialization or Generalization • Step 8: Options for Mapping Specialization or Generalization. • Options 8A and 8B can be called the multiple-relation options. • 8C and 8D can be called the single-relation options

  6. EER Model Example

  7. EER Model Example

  8. EER Model Example

  9. Example

  10. Another Example

  11. EER To Relational MappingsMapping of Union Types • Step 9: Mapping of Union Types (Categories). For mapping a category whose defining super classes have different keys, it is customary to specify a new key attribute, called a surrogate key, when creating a relation to correspond to the category.

  12. Union Type-Example

  13. In-Class Exercises • Apply the ER-to-Relational Mapping Algorithm to the SHIP_TRACKING ER Schema in Figure 9.8 (next slide)

More Related