Database Systems: Enhanced Entity-Relationship Modeling Dr. Taysir Hassan Abdel Hamid.

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 © 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.
Enhanced Entity-Relationship and UML Modeling
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.
The Enhanced Entity- Relationship (EER) Model
December 4, 2002 Data Modeling – James Cohen Enhanced Entity Relationship (EER) Model Presented by James Cohen.
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:
Chapter 41 Enhanced Entity-Relationship and Object Modeling.
EXTENDED-ER (EER) MODEL CONCEPTS. Enhanced-ER (EER) Model Concepts  Basic ER diagram + more concepts =EER model  Additional concepts:  Subclasses/superclasses.
Specialization and generalization
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.
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,
Entities and Attributes
Copyright © 2011 Pearson Education, Inc. Publishing as Pearson Addison-Wesley Chapter 8 The Enhanced Entry-Relationship (EER) Model.
Chapter 4: The Enhanced ER Model and Business Rules
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.
Enhanced Entity – Relationship (EER) and Object Modeling (Based on Chapter 4 in Fundamentals of Database Systems by Elmasri and Navathe, Ed. 4)
THE ENHANCED ER (EER) MODEL CHAPTER 8 (6/E) CHAPTER 4 (5/E)
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.
Database Systems Background Review (2) Dr. Muhammad Shafique
1 CSBP430 – Database Systems Chapter 4: Enhanced Entity– Relationship and Object Modeling Elarbi Badidi College of Information Technology United Arab Emirates.
Exam 1 Review Dr. Bernard Chen Ph.D. University of Central Arkansas Fall 2008.
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.
Copyright © 2007 Ramez Elmasri and Shamkant B. Navathe Chapter 4 Enhanced Entity-Relationship (EER) Modeling.
Exam 1 Review Dr. Bernard Chen Ph.D. University of Central Arkansas.
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
Copyright © 2016 Ramez Elmasri and Shamkant B. Navathe CHAPTER 4 Enhanced Entity-Relationship (EER) Modeling Slide 1- 1.
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.
Database Systems 主講人 : 陳建源 日期 :99/10/19 研究室 : 法 Chapter 4 Enhanced Entity-Relationship and Object Modeling.
CSE202 Database Management Systems
Databases (CS507) CHAPTER 7.
Enhanced Entity-Relationship (EER) Model
The Enhanced Entity- Relationship (EER) Model
Enhanced Entity-Relationship and Object Modeling Objectives
© Shamkant B. Navathe CC.
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
© Shamkant B. Navathe CC.
© Shamkant B. Navathe CC.
CS4222 Principles of Database System
Sampath Jayarathna Cal Poly Pomona
ENHANCED ENTITY-RELATIONSHIP (EER) MODEL
Sampath Jayarathna Cal Poly Pomona
© Shamkant B. Navathe CC.
Enhanced Entity-Relationship (EER) Modeling
Enhanced Entity-Relationship (EER) Modeling
Presentation transcript:

Database Systems: Enhanced Entity-Relationship Modeling Dr. Taysir Hassan Abdel Hamid

2 Agenda Enhanced ER Modeling Superclass/Subclass Relationship Specialization/Generalization Type Inheritance/Constraints/Updates Categorization Higher-Degree Relationships Knowledge Representation Aggregation

3 Enhanced ER Modeling Complex databases exist, including GIS among other variety of applications. These types of databases have more complex requirements Semantic Data Modeling  More complex requirements (class relationship)  Requires more complex data modeling (subclass, superclass, inheritance, category)  Enhance (extend) the simple ER model

4 Enhanced ER Modeling (Cont.) Enhanced Entity Relationship (EER) Model  ER model + semantic data modeling concepts  EER Diagram

5 Superclass/Subclass  Should have meaningful subgroupings  Should be related to database applications  Entities that are members of the EMPLOYEE entity may be grouped further into SECRETAERY, ENGINEER, MANAGER, and so on.  Entity Employee is called the superclass of each of these subclasses  This relationship is called superclass/class or simply class/subclass relationship

6 “IS-A” relationship  Members of a subclass must be members of the superclass  a FULL-TIME STUDENT is a STUDENT  Not every entity in a superclass be a member of a subclass

7 Entity Type Inheritance Type Inheritance among Classes The type of an entity is defined by the attributes it posses and the relationship types in which it participates. Inherited Attributes a subclass inherits the attributes of the superclass HOURLY_EMPLOYEE (Name, SSN, Address) Local (Specific) Attributes a subclass may have its own attributes HOURLY_EMPLOYEE (Hourly_rate) SALARIED_EMPLOYEE (Annual_salary)

8 Direction of the superclass/subclass relationship

9 Relationship Type Inheritance Inherited Relationships A subclass participates in the relationship type(s) of the superclass indirectly cared_by (INPATIENT, PHYSICIAN) Local (Specific) Relationships A subclass may have its own direct relationships assigned_to (INPATIENT, BED)

10 Direction of the superclass/subclass relationship

11 EER Model Concepts Subclasses  Subgroupings of the entities of an entity type  An entity type as a superclass of subclasses  Examples  EMPLOYEE  {SALARIED_EMPLOYEE, HOURLY_EMPLOYEE}  PATIENT  {OUTPATIENT, INPATIENT}  STUDENT  {FULL-TIME, PART-TIME}

12 Specialization and Generalization Specialization Process of defining subclasses of an entity type (superclass) Defined on the basis of some distinguishing characteristics of the entities in the superclass. A (super)class  a set of subclasses Method of pay {SALARIED_EMPLOYEE, HOURLY_EMPLOYEE} Job type {SECRETARY, ENGINEER, TECHICIAN} Why specialization Attributes applied to some but not all entities Only members of the subclass participate in a specific relationship type

13 Specialization and Generalization

14 Why do we include class/subclass relationships and specializations? Certain attributes may apply to some but not all entities of the superclass Some relationship types may be participated in only by entities that are members of the subclass. To summarize, the specialization process allows the following: Define a set of subclasses of an entity Establish additional specific attributes with each subclass Establish additional specific relationship types between each subclass and other entity types or other subclasses.

15 Generalization Process of defining generalized entity type from giving entity types by identifying common features (attributes) A set of (sub)classes  a generalized superclass Inverse of the specialization process {CAR, TRUCK}  VEHICLE : fig4.3fig4.3

16 Generalized Superclass Subclass

17 Constraints for Specialization and Generalization Predicate-defined subclasses: We can determine exactly the entities that will become members of each subclass by placing a condition on the value of some attribute of the superclass.

18 Constraints for Specialization and Generalization Defining attribute Predicate condition Predicate-defined subclass

19 Constraints for Specialization and Generalization (Cont.) Attribute-defined specialization All subclasses have their membership condition on the same attribute of the superclass The specialization itself is called an attribute-defined specialization and the attribute itself is called defining attribute of the specialization. Predicate-defined (condition defined) subclass JobType = ‘Engineer’ => defining predicate User-defined Subclass We do not have a condition for determining membership in a subclass, the sub-class is called is user-defined Each membership is determined by the user

20 Constraints for Specialization and Generalization Defining attribute Predicate condition Predicate-defined subclass

21 Two other Constraints: Disjointness and Completeness Disjointness: The entity can be a member of at most one of the subclasses of the specialization The subclasses of the specialization must be disjoint No entity can be in more than one subclass d notation- disjoint Overlap Entities may belong to several subclasses PERSON  {EMPLOYEE, ALUMNUS, STUDENT} PARTS=>{MANUFACTURED, PURCHASED} (fig4.5)fig4.5

22 Disjointness constraints (cont.)

23 Completeness Constraints Partial An entity in a superclass may not belong to any of the subclasses (fig4.6)fig4.6 {SECRETARY, ENGINEER, TECHNICIAN} Total every entity in a superclass must belong to at least one of the subclasses {SALARIED_EMPLOYEE,HOURLY_EMPLOYEE}

24 Completeness Constraints total partial

25 Disjointness and completeness Independent We have the following four possible constraints: Disjoint, total Disjoint, partial Overlapping, total Overlapping, partial Determined by real-world meaning

26 Update rules for Specialization Deletion cascades to subclasses deleting an entity in a superclass leads to the deletion of the entity in the subclasses Insertion cascades to subclasses Automatic insertion of an entity in the subclass(es) For predicate-defined subclasses For total specialization

27 Specialization Hierarchy and Lattices Specialization Hierarchy a subclass may have further subclasses every subclass has ONLY ONE superclass a subclass inherits the attributes/relationships not only of its immediate superclass but also of all indirect superclasses in the hierarchy the key of a subclass is the key of the most general superclass

28 Each subclass participates as a subclass in only one class/subclass relationship; Each subclass has only one parent

29 Specialization Hierarchy and Lattices Shared Subclass (fig4.7)fig4.7 a subclass with more than one superclass STUDENT ASST  (EMPLOYEE and STUDENT) Existence of shared subclass leads to lattices Multiple Inheritance a shared subclass inherits attributes and relationships from multiple superclasses combinations of subclasses (EMPLOYEE, ALUMNUS, STUDENT)

30 fig4.7: A Specialization lattice with multiple inheritance for a UNIVERSITY database fig4.7

31 Refine Conceptual Schema Design Specialization and generalization Top-Down Conceptual Refinement Start with one entity type Successive specializations from a class into subclasses Bottom-up Conceptual Synthesis successive generalizations by forming a superclass from several classes

32 Categorization by UNION Category (Union Type) a subclass represent a collection of objects that is a subset of the UNION of distinct entity types. (notation,  ) (CAR  TRUCK)  REGISTERED_VEHICLE a category is a subset of the union of its superclasses a category has two or more superclasses other superclass/subclass relationships always have a single superclass

33 category Set union operation

34 Categorization by UNION Attributes Inheritance a category inherits attributes only from the single superclass it belongs to (fig4.8)fig4.8 Category vs. Generalized Superclass (CAR  TRUCK)  REGISTERED_VEHICLE {CAR, TRUCK}  VEHICLE (fig4.3)fig4.3 VEHICLE may include another type (e.g., MOTORCYCLE) if partial participation

35 category Set union operation

36 Categorization by UNION Category vs. Shared Subclass (CAR  TRUCK)  REGISTERED_VEHICLE (GASOLINE  ELECTRIC)  HYBRID a shared subclass is a subclass of each of the superclasses a shared subclass is a subset of the intersection of the superclasses a category is a subset of the union of its superclasses

37 Mathematical Notation Super/Subclass Relationship subclass: S, superclass: C S  C (S is a subset of C) IS-A relationship: an entity in S is also in C Specialization/Generalization a set of subclasses: Z  {S 1, S 2,.., S n } a superclass: G  (S i )  G

38 Mathematical Notation Constraints Total: U (S i )  G Partial: U (S i )  G Disjoint: S i  S j   (empty set) for i  j Overlap: S i  S j   (empty set) for i  j Categorization a set of superclasses: (D 1, D 2,.., D n ) T   (D i )

39 Conceptual Object Modeling Object Modeling Methodologies in software engineering: UML, OMT, … specify operations applied to objects (entities) class = entity type (attributes) + operations Object Modeling Concepts (vs. EER) class: entity type, object: entity association (link): relationship (rel. instance) multiplicity: relationship constraint

40 UML Conceptual Schema UML Class Diagram Figure 4.10 (vs. fig3.15) Figurefig3.15 class: class_name, attributes, operations (min, max) notation, optional value set aggregation: whole-part relationship Specialization Notation fig4.10 (vs. fig4.7) fig4.10fig4.7 disjoint vs. overlapping specialization

Knowledge Representation Knowledge Representation (KR) Concepts for accurately modeling some domain of knowledge by creating an ontology Similar to conceptual schema, but with more knowledge, rules, and exceptions Include reasoning mechanism that deduce additional facts from the stored facts Knowledge-based systems can answer queries that involve inferences over the stored data

Knowledge Representation KR vs. Semantic Data Modeling (SDM) Both disciplines use an abstraction process to identify common properties and important aspects of objects Both disciplines provide concepts, constraints, operations, and languages for defining and representing knowledge KR is generally broader in scope than semantic models. Different forms of knowledge, such as rules (used in inference and search) KR schemes include reasoning mechanisms that deduce additional facts from the facts stored in the database. KR schemes often mix up the schemas with the instances themselves in order to provide flexibility in representing exceptions.

Abstraction Concepts Used in both Semantic Data Models, such as EER and KR schemes Classification/Instantiation: Classification involves assigning similar objects/entities to object classes/entity types Instantiation is the inverse of classification and refers to the generation and specific examination of distinct objects of a class An object instance is related to its object class by the IS- AN-INSTANCE-OF or IS-A-MEMBER-OF relationship Identification: Is the abstraction process whereby classes and objects are uniquely identifiable. Specialization/Generalization Aggregation/Association

Aggregation generates composite objects from their component objects, while association associates objects for several independent classes Aggregate object IS-PART-OF; the inverse is called IS-A-COMPONENT-OF The abstraction of association is associate objects from several independent classes. This abstract relationship is called IS-ASSOCIATED_WITH

Ontologies and the Semantic Web Allow information exchange on the web. Semantic web is creating knowledge representation models that are quite general in order to allow meaningful information exchange and search among machines.