EER Model – Chapter 4.1-4.3.

Slides:



Advertisements
Similar presentations
© Shamkant B. Navathe CC. © Shamkant B. Navathe CC Chapter 4 - Part I Enhanced Entity-Relationship and UML Modeling Copyright © 2004 Ramez Elmasri and.
Advertisements

1 Class Number – CS 304 Class Name - DBMS Instructor – Sanjay Madria Instructor – Sanjay Madria Lesson Title – EER Model –21th June.
Copyright © 2007 Ramez Elmasri and Shamkant B. Navathe Slide 4- 1.
Copyright © 2007 Ramez Elmasri and Shamkant B. Navathe Slide 4- 1.
Copyright © 2007 Ramez Elmasri and Shamkant B. Navathe Chapter 4 Enhanced Entity-Relationship (EER) Modeling.
1 Enhanced Entity Relationship Modelling EER Model Concepts Includes all basic ER modeling concepts Additional concepts: subclasses/superclasses specialization/generalization.
Copyright © 2011 Pearson Education, Inc. Publishing as Pearson Addison-Wesley Chapter 9 Relational Database Design by ER- and EER-to- Relational Mapping.
Chapter 4 The Enhanced Entity-Relationship (EER) Model
© Shamkant B. Navathe CC METU Department of Computer Eng Ceng 302 Introduction to DBMS Enhanced Entity-Relationship (EER) Model by Pinar Senkul resources:
EXTENDED-ER (EER) MODEL CONCEPTS. Enhanced-ER (EER) Model Concepts  Basic ER diagram + more concepts =EER model  Additional concepts:  Subclasses/superclasses.
Copyright © 2007 Ramez Elmasri and Shamkant B. Navathe Slide 4- 1 EER stands for Enhanced ER or Extended ER EER Model Concepts Includes all modeling concepts.
Enhanced Entity-Relationship and UML Modeling. Enhanced-ER (EER) Model Concepts Includes all modeling concepts of basic ER Additional concepts: subclasses/superclasses,
Enhanced Entity-Relationship Model (EER) 1. Enhanced-ER (EER) Model Concepts Includes all modeling concepts of basic ER Additional concepts: subclasses/superclasses,
ER- and EER-to-Relational Mapping
Copyright © 2007 Ramez Elmasri and Shamkant B. Navathe Slide 7- 1.
Copyright © 2011 Pearson Education, Inc. Publishing as Pearson Addison-Wesley Chapter 8 The Enhanced Entry-Relationship (EER) Model.
© Shamkant B. Navathe CC. © Shamkant B. Navathe CC Chapter 4 - Part I Enhanced Entity-Relationship and UML Modeling Copyright © 2004 Ramez Elmasri and.
Enhanced Entity – Relationship (EER) and Object Modeling (Based on Chapter 4 in Fundamentals of Database Systems by Elmasri and Navathe, Ed. 4)
EER Model.
Enhanced Entity-Relationship (EER) Modeling. Slide 4- 2 Chapter Outline EER stands for Enhanced ER or Extended ER EER Model Concepts Includes all modeling.
ER/EER to Relational Mapping Chapter 9. STEP 1 ENTITY TYPE E (non weak) -> NEW RELATION T RELATION T: – includes all simple attributes (non composite,
1 CSBP430 – Database Systems Chapter 4: Enhanced Entity– Relationship and Object Modeling Elarbi Badidi College of Information Technology United Arab Emirates.
Copyright © 2007 Ramez Elmasri and Shamkant B. Navathe Slide 4- 1.
Elmasri and Navathe, Fundamentals of Database Systems, Fourth Edition Copyright © 2004 Ramez Elmasri and Shamkant Navathe Enhanced-ER (EER) Model Concepts.
Chapter 4 Extended Entity-Relationship (EER)Model Incorporates Set-subset Relationships Incorporates Generalization Hierarchies Constraints: Coverage Constraints:
Copyright © 2007 Ramez Elmasri and Shamkant B. Navathe Chapter 4 Enhanced Entity-Relationship (EER) Modeling.
© Shamkant B. Navathe CC Enhanced Entity-Relationship Copyright © 2004 Ramez Elmasri and Shamkant Navathe.
Topic 4 - Part I Enhanced Entity-Relationship and UML Modeling
Extended ER Modelling. Extended E-R Features: Specialization Top-down design process; we designate subgroupings within an entity set that are distinctive.
Lecture 3 A short revision of ER and EER modelling See R. Elmasri, S.B. Navathe. Fundamentals of Database Systems (third edition) Addison-wesley. Chapter.
Copyright © 2007 Pearson Education, Inc. Publishing as Pearson Addison-Wesley Slide 4- 1.
Chapter 4_part2: The Enhanced Entity-Relationship (EER) Model.
Databases (CS507) CHAPTER 8
Lecture # 21 Chapter # 7 Relational Database Design by ER- and EER-to-Relational Mapping Muhammad Emran Database Systems.
Databases (CS507) CHAPTER 7.
Relational Database Design by ER- and ERR-to-Relational Mapping
Relational Database Design by ER- and EER-to- Relational Mapping
Enhanced Entity-Relationship (EER) Model
The Enhanced Entity- Relationship (EER) Model
Enhanced Entity-Relationship and Object Modeling Objectives
© Shamkant B. Navathe CC.
Relational Database Design by ER- and EER-to- Relational Mapping
Enhanced Entity-Relationship (EER) Modeling
The Enhanced Entity- Relationship (EER) Model
Enhanced Entity-Relationship (EER) Modeling
Session 2 Welcome: The sixth learning sequence
Enhanced Entity-Relationship (EER) Modeling
Enhanced ER Modeling Transparencies
ER- and EER-to-Relational
9/5/2018.
11/15/2018.
© Shamkant B. Navathe CC.
Chapter 8: Mapping a Conceptual Design into a Logical Design
© Shamkant B. Navathe CC.
EER to Relational Mapping
CS4222 Principles of Database System
Sampath Jayarathna Cal Poly Pomona
Relational Database Design by ER- and EERR-to-Relational Mapping
4/11/2019.
Database EER.
ENHANCED ENTITY-RELATIONSHIP (EER) MODEL
Sampath Jayarathna Cal Poly Pomona
© Shamkant B. Navathe CC.
Enhanced Entity-Relationship (EER) Modeling
Relational Database Design by ER- and EER-to-Relational Mapping
Enhanced Entity-Relationship (EER) Modeling
CS4222 Principles of Database System
7/19/2019.
Presentation transcript:

EER Model – Chapter 4.1-4.3

Why EER? -- Enhanced Entity Relationship There are limitations to the ER model ER model enhanced (EER) to include:  superclass/subclass relationships type inheritance specialization and generalization constraints

Subclasses Subclass of an entity type relationship – is-a derive subclass from superclass manager “is a(n)” employee    subset symbol in connecting line member of a subclass must also be a member of some superclass

Ù

Type inheritance inherit all attributes of superclass useful for modeling, convenience

Specialization Specialization e.g. salaried and hourly – specialization of employee circle connecting all specialized subclasses still use subset symbol to connect subclass to circle specific attributes attached to subclass subclasses can also participate in specific relationship types

Specialization Constraints Predicate defined (condition-defined) subclasses manager = True  has a defining predicate for the subclass Attribute defined if all subclasses have membership based on same attribute User defined - if no condition

Constraints cont’d Disjointedness constraint Otherwise, subclasses disjoint member of at most 1 subclass use ‘d’ in circle to indicate Otherwise, Overlapping constraint sets of entities may overlap member of more than 1 subclass use ‘o’ in circle to indicate

Constraints cont’d Completeness constraint total specialization every entity in superclass must be member of some subclass of specialization indicate with double line from superclass to circle   partial specialization entity does not have to belong to any subclass indicate with single line   Can have disjoint total, disjoint partial, overlapping total, overlapping partial

Generalization Generalization of entity types into a single superclass vehicle is generalization of car, truck

Specialization/Generalization Lattice a class can be a subclass in more then one class/subclass relationship an entity may exist in several leaf nodes multiple inheritance

Add subclasses to employee Manager, supervisor

Union Types Union of objects of different entity types (superclasses) Union type is a subclass of a collection of objects that is a subset of the union of its superclasses Union means can only be a member of one of the superclasses Different from multiple inheritance, which was subset of intersection of superclasses, e.g. was an engineer and a manager and a salaried employee Can only inherit attributes from one superclass, not all Can even have different key attributes, depending on which inherit from

Union Types Subclass of the union of 2 or more subclasses create a new table PK is a surrogate key, since it can have different types of PKs Include surrogate key as foreign key in all tables corresponding to the superclasses If entity is not a member of subclass, foreign key is null Can add a type attribute to indicate to which superclass entity is a member

UML notation – Chap. 4.6 Subclasses - specialization/generalization (is-a) Triangle to indicate blank triangle is disjoint filled triangle is overlapping Aggregation – relationship between object and component parts (has-a relationship) Diamond indicates whole vs. part

The remaining slides will be discussed later

Step 8 - Mapping EER model concepts to Relations Superclass/Subclass and Specialization/Generalization Convert each specialization with m subclasses {S1, S2, ..Sm} and superclass C where attributes of C are: {PK, A1, ...An} Using 1 of the following options:

Option 1 (Option A in book) Create a new relation L with attributes of C Create new relations Li for each subclass Si with attributes {PK} U {attr. of Si}

Option 2 (Option B in book) Create new relations Li for each subclass Si with attributes (attr. of Si} U {PK, Ai, ..An}

Option 3 (Options C and D in book) Create one new relation L with attributes {PK, Ai, ..An} U (attr. of S1} U{attr. of S2} ... U {attr. of Sm} U {t1, ... tm} each ti is a Boolean indicating whether tuple belongs to Si Have one type field t, instead of m type fields if disjoint

Summary of Options Option 1 Option 2 Option 3 Create one table for superclass, and one table for each subclass Include PK of superclass in subclass tables Option 2 Create one table for each subclass include superclass attributes in each subclass table Option 3 Create one table with attributes from superclass and all subclasses If overlapping, include m columns, one for each subclass to indicate membership in that subclass If disjoint, include 1 column to indicate which subclass a member of

Which option is better/worse under which circumstances?