Databases Illuminated Chapter 8 The Enhanced Entity-Relationship Model and the Object-Relational Model.

Slides:



Advertisements
Similar presentations
Outline Data, Information & Knowledge Database DBMS Types of Models
Advertisements

Relational Database Design Via ER Modelling
© Shamkant B. Navathe CC. © Shamkant B. Navathe CC Chapter 4 - Part I Enhanced Entity-Relationship and UML Modeling Copyright © 2004 Ramez Elmasri and.
Chapter 4: Enhanced Entity-Relationship (EER) Modeling
Database Systems: Design, Implementation, and Management Eighth Edition Chapter 6 Advanced Data Modeling.
1 Class Number – CS 304 Class Name - DBMS Instructor – Sanjay Madria Instructor – Sanjay Madria Lesson Title – EER Model –21th June.
Enhanced Entity-Relationship and Object Modeling (Ch 4) Jan R McFadyen1 Class/subclass relationships Inheritance Specialization Generalization.
Copyright © 2007 Ramez Elmasri and Shamkant B. Navathe Slide 4- 1.
Copyright © 2007 Ramez Elmasri and Shamkant B. Navathe Slide 4- 1.
Copyright © 2011 Pearson Education, Inc. Publishing as Pearson Addison-Wesley Chapter 8 The Enhanced Entity- Relationship (EER) Model.
Copyright © 2011 Pearson Education, Inc. Publishing as Pearson Addison-Wesley Chapter 7 Conceptual Data Modeling Using Entities and Relationships.
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.
December 4, 2002 Data Modeling – James Cohen Enhanced Entity Relationship (EER) Model Presented by James Cohen.
© Shamkant B. Navathe CC METU Department of Computer Eng Ceng 302 Introduction to DBMS Enhanced Entity-Relationship (EER) Model by Pinar Senkul resources:
Chapter 41 Enhanced Entity-Relationship and Object Modeling.
Copyright © 2011 Pearson Education, Inc. Publishing as Pearson Addison-Wesley Chapter 8 The Enhanced Entity- Relationship (EER) Model.
Enhanced Entity Relationship Modeling © 2002 by Dietrich and Urban1 ADVANCED DATABASE CONCEPTS Enhanced Entity Relationship Modeling Susan D. Urban and.
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,
Chapter 91 ER & EER to Relational Mapping. Chapter 92 ER to Relational Mapping Step 1: For each regular entity type E in the ER schema, create a relation.
Copyright © 2011 Pearson Education, Inc. Publishing as Pearson Addison-Wesley Chapter 9 Relational Database Design by ER- and EER-to-Relational Mapping.
ER- and EER-to-Relational Mapping
Entities and Attributes
Database System Concepts, 5th Ed. Chapter 6: Entity-Relationship Model.
Copyright © 2011 Pearson Education, Inc. Publishing as Pearson Addison-Wesley Chapter 8 The Enhanced Entry-Relationship (EER) Model.
1 CSE 480: Database Systems Lecture 4: Enhanced Entity-Relationship Modeling Reference: Read Chapter 8.1 – 8.5 of the textbook.
© Shamkant B. Navathe CC. © Shamkant B. Navathe CC Chapter 4 - Part I Enhanced Entity-Relationship and UML Modeling Copyright © 2004 Ramez Elmasri and.
EXAMPLE. Subclasses and Superclasses Entity type may have sub-grouping that need to be represented explicitly. –Example: Employee may grouped into.
Database Systems: Enhanced Entity-Relationship Modeling Dr. Taysir Hassan Abdel Hamid.
Chapter 11 & 12 Entity-Relationship (E-R) Model Characteristics of E-R Model Components of E-R Model Example of E-R Model Enhanced E-R Model.
Chapter 2 : Entity-Relationship Model Entity Sets Relationship Sets Design Issues Mapping Constraints Keys E-R Diagram Extended E-R Features Design of.
UNIT_2 1 DATABASE MANAGEMENT SYSTEM[DBMS] [Unit: 2] Prepared By Lavlesh Pandit SPCE MCA, Visnagar.
Databases Illuminated Chapter 3 The Entity Relationship 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.
Keys for Relationship Sets The combination of primary keys of the participating entity sets forms a super key of a relationship set. – (customer-id, account-number)
DatabaseIM ISU1 Chapter 7 ER- and EER-to-Relational Mapping Fundamentals of Database Systems.
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.
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.
CST203-2 Database Management Systems Lecture 4. Student entity NIDFNameLNameRegNoExamIdBirthdate.
Slide 4-1 Elmasri and Navathe, Fundamentals of Database Systems, Fourth Edition Revised by IB & SAM, Fasilkom UI, 2005 Exercise 1. a property or description.
© Shamkant B. Navathe CC Enhanced Entity-Relationship Copyright © 2004 Ramez Elmasri and Shamkant Navathe.
Topic 4 - Part I Enhanced Entity-Relationship and UML Modeling
CSE 412/598 DATABASE MANAGEMENT COURSE NOTES 3. ENTITY-RELATIONSHIP CONCEPTUAL MODELING Department of Computer Science & Engineering Arizona State University.
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.
Enhanced Entity-Relationship and UML Modeling. 2.
Copyright © 2007 Pearson Education, Inc. Publishing as Pearson Addison-Wesley Slide 4- 1.
Chapter 4_part2: The Enhanced Entity-Relationship (EER) Model.
Enhanced Entity-Relationship (EER) Model
The Enhanced Entity- Relationship (EER) Model
© Shamkant B. Navathe CC.
Conceptual Design & ERD Modelling
Relational Database Design by ER- and EER-to- Relational Mapping
The Enhanced Entity- Relationship (EER) Model
EER Model – Chapter
Enhanced Entity-Relationship (EER) Modeling
ER- and EER-to-Relational
© Shamkant B. Navathe CC.
Relational Database Design by ER- and EER-to-Relational Mapping
© Shamkant B. Navathe CC.
Chapter 6: Entity-Relationship Model
Database EER.
© Shamkant B. Navathe CC.
Enhanced Entity-Relationship (EER) Modeling
Enhanced Entity-Relationship (EER) Modeling
Presentation transcript:

Databases Illuminated Chapter 8 The Enhanced Entity-Relationship Model and the Object-Relational Model

Why Extend the E-R Model? E-R suitable for traditional business applications E-R not semantically rich enough for advanced applications Applications where E-R is inadequate –Geographical information systems –Search engines –Data mining –Multimedia –CAD/CAM –Software development –Engineering design –Financial services –Digital publishing –Telecommunications –...and others

Specialization Abstraction Specialization-needed when an entity set has subsets that have special attributes or that participate in special relationships Process of breaking up a class into subclasses Ex: Faculty contains AdjunctFac and FullTimeFac –All Faculty have attributes facid, lastName, firstName, rank. –AdjunctFac also have coursePayRate –FullTimeFac have annualSalary

Representing Specialization E-ER diagram – See Figure 8.1(a) - shows specialization circle (isa relationship), and inheritance symbol (subset symbol)Figure 8.1(a) Specialization can also involve just one subclass – no need for circle, but show inheritance symbol –see Figure 8.1(b)Figure 8.1(b) Ex. Class has LabClass specialization Subclasses can participate in their own relationships – See Figure 8.1(c)Figure 8.1(c) Ex. FullTimeFac subscribes to Pension

Generalization Abstraction Inverse of specialization Recognizing that classes have common properties and identifying a superclass for them Ex. Student and Faculty are both people Bottom-up process, as opposed to top- down process of specialization EER diagram is the same as for specialization – See Figure 8.1(d)Figure 8.1(d)

Generalization/Specialization Constraints Subclasses can be overlapping or disjoint Place o or d in specialization circle to indicate constraint Specialization can be total (every member of superclass must be in some subclass) or partial –Total -double line connecting superclass to specialization circle –Partial-single line See Figure 8.2 Specialization definition can be –predicate-defined - each subclass has a defining predicate –Attribute defined – the value of the same attribute is used in defining predicate for all subclasses –User-defined – user responsible for identifying proper subclass See Figure 8.3(a), See Figure 8.3(a), and Figure 8.3(b)Figure 8.3(b)

Multiple Specializations Can have different specializations for the same class Ex. Figure 8.3(c) shows undergraduates specialized by year and by residence. These are independent of each otherFigure 8.3(c) Can have shared subclasses – have multiple inheritance from two or more superclasses Ex. Figure 8.4 shows Teaching Assistant as subclass of both Faculty and Student. Figure 8.4

Union or Category Subclass related to a collection of superclasses Each instance of subclass belongs to one, not all, of the superclasses Superclasses form a union or category Ex. A Sponsor may be a team, a department, or a club See Figure 8.5(a), top portionFigure 8.5(a), Each Sponsor entity instance is a member of one of these superclasses, so Sponsor is a subclass of the union of Team, Dept, Club EER diagram - connect each superclass to union circle, connect circle to subclass, with subset symbol on line bet circle and subclass

Total and Partial Unions Total category – every member of the sets that make up the union must participate –Shown on E-ER by double line from union circle to subset In Figure 8.5(b) every Concert or Fair must be a Campus-Wide EventFigure 8.5(b) Partial category – not every member of the sets must participate –Shown by single line Not every Club, Team, or Dept must be a Sponsor

Total Union vs. Specialization Total union can often be replaced by hierarchy Choose hierarchy representation if superclasses have many common attributes See Figure 8.6Figure 8.6

(min,max) Notation for Relationships Shows both cardinality and participation constraints Can be used for both E-R and E-ER diagrams Use pair of integers (min,max) on line connecting entity to relationship diamond –min is the least number of relationship instances an entity must participate in –max is the greatest number it can participate in (can write M or N for many); some authors use * for many –See Figure 8.7 and Figure 8.8Figure 8.7 Figure 8.8

E-ER to Strictly Relational Model -1 For entity sets that are not part of generalization or union, do the mapping as usual –Map strong entity sets to tables, with column for each attribute, but For composite attributes, create column for each component, or single column for composite For multi-valued attribute, create separate table with primary key of entity, plus multi-valued attribute as composite key –Weak entity sets – include primary key of owner –Binary Relationships 1-M: use key of “one” side as foreign key in “many” side 1-1: use either key as foreign key in the other’s table M-M: create relationship table with both primary keys –Higher-Order Relationships-create relationship table

E-ER to Strictly Relational Model-2 Mapping Class Hierarchies to Tables –Method 1: Create a table for superclass and one for each of the subclasses, placing primary key of superclass in each subclass Ex : Faculty(facId, lastName, firstName, rank) AdjunctFac(facId, coursePayRate) FullTimeFac(facId, annualSalary) –Method 2: Create table for each subclass, including all attributes of superclass in each, with no table for superclass Ex: AdjunctFac(facId, lastName, firstName, rank, coursePayRate) FullTimeFac(facId, lastName, firstName, rank, annualSalary) –Method 3: Create a single table with all attributes of superclass and of all subclasses Ex: AllFac(facId, lastName, firstName, rank, annualSalary, coursePayRate) –Variation of method 3 is to add a “type field” to each record, indicating subclass it belongs to

E-ER to Strictly Relational Model-3 Mapping Unions –create table for the union itself, and individual tables for each of the superclasses, using foreign keys to connect them. Include a type code field in union table Ex: CampusWideEvent(eventName, date, time, eventType) Concert(eventName, performer) Fair(eventName, theme, charity) If superclasses have different primary keys, create a surrogate key which will be the primary key of the union and a foreign key in each subclass table Ex: Sponsor(sponsorId, sponsorType) Club(clubName, president, numberOfMembers, sponsorId) Team(teamName, coach, sport, sponsorId) Department(deptName, deptCode, office, sponsorId)