The Enhanced E-R (EER) Model

Slides:



Advertisements
Similar presentations
THE EXTENDED ENTITY RELATIONSHIP MODEL (EERM)
Advertisements

1 © Prentice Hall, 2002 Chapter 4: The Enhanced E-R Model and Business Rules Modern Database Management 6 th Edition Jeffrey A. Hoffer, Mary B. Prescott,
Chapter 4: The Enhanced ER Model and Business Rules
Enhanced E-R Models and Business Rules
1 Chapter 4 The Enhanced ER Model and Business Rules.
Chapter 3: The Enhanced E-R Model
Basic notation for supertype/subtype relationships
Enhanced Entity-Relationship Modeling. Strong and Weak Entity Types Strong entity: Each object is uniquely identifiable using primary key of that entity.
Chapter 3 The Enhanced E-R Model
© 2011 Pearson Education, Inc. Publishing as Prentice Hall 1 Chapter 3: The Enhanced E-R Model Modern Database Management 10 th Edition Jeffrey A. Hoffer,
Chapter 3  Define terms  Understand use of supertype/subtype relationships  Understand use of specialization and generalization techniques  Specify.
1 © Prentice Hall, 2002 Chapter 4: The Enhanced E-R Model and Business Rules Modern Database Management 6 th Edition Jeffrey A. Hoffer, Mary B. Prescott,
Chapter 3 © 2013 Pearson Education, Inc. Publishing as Prentice Hall 1 CHAPTER 4: THE ENHANCED E-R MODEL Modern Database Management 11 th Edition Jeffrey.
Database Systems: Design, Implementation, and Management Eighth Edition Chapter 6 Advanced Data Modeling.
CHAPTER 3: THE ENHANCED E-R MODEL © 2013 Pearson Education, Inc. Publishing as Prentice Hall 1 Modern Database Management 11 th Edition Jeffrey A. Hoffer,
1 © Prentice Hall, 2002 Chapter 4: The Enhanced E-R Model and Business Rules Modern Database Management 6 th Edition Jeffrey A. Hoffer, Mary B. Prescott,
Chapter 4 © 2005 by Prentice Hall 1 Objectives Definition of terms Definition of terms Use of supertype/subtype relationships Use of supertype/subtype.
Chapter 4: The Enhanced ER Model and Business Rules
Enhanced Entity-Relationship Modeling
IS 4420 Database Fundamentals Chapter 4: The Enhanced ER Model and Business Rules Leon Chen.
December 4, 2002 Data Modeling – James Cohen Enhanced Entity Relationship (EER) Model Presented by James Cohen.
Chapter 4: The Enhanced E-R Model and Business Rules
Chapter 4 1 Chapter 4: The Enhanced ER Model and Business Rules.
1 Chapter 4 Enhanced E-R Model. 2 Supertypes and Subtypes Subtype: A subgrouping of the entities in an entity type which has attributes that are distinct.
Chapter 3: The Enhanced E-R Model
1 Chapter 4: The Enhanced ER Model and Business Rules.
Enhanced Entity-Relationship Model (EER) 1. Enhanced-ER (EER) Model Concepts Includes all modeling concepts of basic ER Additional concepts: subclasses/superclasses,
 Keys are special fields that serve two main purposes: ◦ Primary keys are unique identifiers of the relation in question. Examples include employee numbers,
1 Web-Enabled Decision Support Systems Entity-Relationship Modeling Prof. Name Position (123) University Name.
Entities and Attributes
© 2011 Pearson Education, Inc. Publishing as Prentice Hall 1 Chapter 3: The Enhanced E-R Model Modern Database Management 10 th Edition Jeffrey A. Hoffer,
© 2007 by Prentice Hall (Hoffer, Prescott & McFadden) 1 The Enhanced Entity Relationship Diagrams (E-ERDs)
Chapter 4: The Enhanced ER Model and Business Rules
Database Systems: Enhanced Entity-Relationship Modeling Dr. Taysir Hassan Abdel Hamid.
Chapter 4 1 Chapter 4: The Enhanced ER Model and Business Rules Modern Database Management Jeffrey A. Hoffer, Mary B. Prescott, Fred R. McFadden.
Database Development Supertype, Subtype, and Business Rules Powered by DeSiaMore 1.
© 2009 Pearson Education, Inc. Publishing as Prentice Hall 1 Modeling Data in the Organization Chapters 3 + 4: Modern Database Management 9 th Edition.
Chapter 3: The Enhanced E-R Model
1 The Enhanced Entity Relationship Diagrams (E-ERDs)
Enhanced Entity-Relationship and Object Modeling Chapter 4
Chapter 3: The Enhanced E-R Model
CHAPTER 3: THE ENHANCED E-R MODEL © 2013 Pearson Education, Inc. Publishing as Prentice Hall 1 Modern Database Management 11 th Edition Jeffrey A. Hoffer,
© 2011 Pearson Education 1 Chapter 3: Advanced Database Analysis Modern Database Management 10 th Edition, International Edition Jeffrey A. Hoffer, V.
CHAPTER 3: THE ENHANCED E-R MODEL © 2013 Pearson Education, Inc. Publishing as Prentice Hall 1 Modern Database Management 11 th Edition Jeffrey A. Hoffer,
Database Systems Supertypes and Subtypes Lecture # 10.
Database Management System Prepared by Dr. Ahmed El-Ragal Reviewed & Presented By Mr. Mahmoud Rafeek Alfarra College Of Science & Technology- Khan younis.
Entity Relationship Modeling
Enhanced Entity-Relationship Modeling
© Shamkant B. Navathe CC Enhanced Entity-Relationship Copyright © 2004 Ramez Elmasri and Shamkant Navathe.
© 2009 Pearson Education, Inc. Publishing as Prentice Hall 1 Chapter 4: The Enhanced E-R Model and Business Rules Modern Database Management 9 th Edition.
© 2009 Pearson Education, Inc. Publishing as Prentice Hall 1 Chapter 4: The Enhanced E-R Model Modern Database Management 9 th Edition Jeffrey A. Hoffer,
Advance Database Engineering 1 Chapter 4: The Enhanced ER Model and Business Rules Modern Database Management 7 th Edition Jeffrey A. Hoffer, Mary B. Prescott,
Copyright © 2016 Pearson Education, Inc. Modern Database Management 12 th Edition Jeff Hoffer, Ramesh Venkataraman, Heikki Topi CHAPTER 3: THE ENHANCED.
Lecture # 14 Chapter # 5 The Relational Data Model and Relational Database Constraints Database Systems.
© 2005 by Prentice Hall 1 Chapter 4: The Enhanced ER Model and Business Rules Modern Database Management 7 th Edition Jeffrey A. Hoffer, Mary B. Prescott,
1 Database Design Entity-Relationship Modeling N. Ilayaraja PSG Tech.
Databases (CS507) CHAPTER 7.
Chapter 3: The Enhanced E-R Model
The Enhanced E-R Model and Business Rules
LECTURE 4: Chapter 4: The Enhanced E-R Model
Advanced Database Analysis
Chapter 4: The Enhanced E-R Model and Business Rules
Chapter 4: The Enhanced ER Model and Business Rules
Database Management System 1 (ITED123A)
Chapter 3: The Enhanced E-R Model
Overview of Entity‐Relationship Model
CHAPTER 3: THE ENHANCED E-R MODEL
MBA 664 Database Management
MIS 385/MBA 664 Systems Implementation with DBMS/ Database Management
CGS 2545: Database Concepts Summer 2006
Presentation transcript:

The Enhanced E-R (EER) Model EER model is used to identify the model that has resulted form extending the original ER model with these new modeling constructs. These extensions make the EER model semantically similar to object-oriented data modeling.

Why EER Model? Business environment has changed dramatically Business relationships become more complex, so is business data Business rules thus need a more powerful modeling mechanism. Object oriented database technology Change in database technique is expensive

Enhanced ER model Student : Undergraduate Student : Graduate Student EER model extends original ER model with two new modeling constructs – supertype and subtype Supertype Subtype Student : Undergraduate Student : Graduate Student Guitar : Acoustic : Electric Employee : Hourly Employee : Salaried Employee : Consultant

Supertypes and Subtypes Supertype: A generic entity that has a relationship with one or more subtypes Generalized type Subtype: A subgrouping of the generic entity that has attributes distinct from those in other subgroupings Specialized type

Example – Employee Hourly Employees: Salaries Employees: Consultants Employee Number, Employee Name, Address, Date Hired, Hourly Rate Salaries Employees: Employee Number, Employee Name, Address, Date Hired, Annual Salary, Stock Option Consultants Employee Number, Employee Name, Address, Date Hired, Contract Number, Billing Rate

Option 1 EMPLOYEE Employee Number Employee Name Address Date Hired Hourly Rate Annual Salary Stock Option Contract Number Billing Rate EMPLOYEE

Option 2 HOURLY SALARIED CONSULTANT EMPLOYEE EMPLOYEE Employee Num Employee Name Address Date Hired Hourly Rate HOURLY EMPLOYEE Employee Num Employee Name Address Date Hired Annual Salary Stock Option SALARIED EMPLOYEE Employee Num Employee Name Address Date Hired Contract Num Billing Rate CONSULTANT

Option 3 All employee subtypes will have employee number, name, address, and date hired Each employee subtype will also have its own attributes

Attribute Inheritance The property by which subtype entities inherit values of all attributes of the supertype Attributes that are shared by all entities are associated with the supertype Attributes that are unique to a particular subtype are associated with that subtype. An entity instance of a subtype represents the same entity instance of the supertype. A member of a subtype must be a member of the supertype Not necessary vice versa

Figure 3-2 Employee supertype with three subtypes All employee subtypes will have employee number, name, address, and date hired Each employee subtype will also have its own attributes Attributes shared by all employees are associated with EMPLOYEE. Attributes that are peculiar to each subtype are included with that subtype only.

HOURLY EMPLOYEE EMPLOYEE SALARIED EMPLOYEE CONSULTANT

Relationships Inheritance Relationships at the supertype level indicate that all subtypes will participate in the relationship The instances of a subtype may participate in a relationship unique to that subtype. In this situation, the relationship is shown at the subtype level

Figure 3-3 Supertype/subtype relationships in a hospital Both outpatients and resident patients are cared for by a responsible physician Only resident patients are assigned to a bed

When to use supertype/subtype relationships? There are attributes that apply to only some instances of an entity. Result in many Null values The instances of a subtype participate in a relationship unique to that subtype

Figure 3-1 Basic notation for supertype/subtype notation a) EER notation

Processes to create identify supertype/subtype relationships Generalization: The process of defining a more general entity type from a set of more specialized entity types. BOTTOM-UP

Figure 3-4 Example of generalization a) Three entity types: CAR, TRUCK, and MOTORCYCLE All these types of vehicles have common attributes

Figure 3-4 Example of generalization (cont.) b) Generalization to VEHICLE supertype So we put the shared attributes in a supertype Draw example Note: no subtype for motorcycle, since it has no unique attributes (remember the conditions to create subtypes?)

Vehicle Car Instance of Motorcycle Truck

Processes to create identify supertype/subtype relationships Specialization: The process of defining one or more subtypes of the supertype and forming supertype/subtype relationships. TOP-DOWN

Figure 3-5 Example of specialization a) Entity type PART Only applies to manufactured parts Applies only to purchased parts

Figure 3-5 Example of specialization (cont.) b) Specialization to MANUFACTURED PART and PURCHASED PART Note: multivalued attribute was replaced by an associative entity relationship to another entity Created 2 subtypes

Constraints in Supertype Completeness Constraints: Whether an instance of a supertype must also be a member of at least one subtype Disjointness Constraints: Whether an instance of a supertype may simultaneously be a member of two (or more) subtypes Subtype Discriminator: An attribute of the supertype whose values determine the target subtype(s) The three constraints are used in combination

Constraints in Supertype Completeness Constraints: Whether an instance of a supertype must also be a member of at least one subtype Total Specialization Rule: Yes (double line) Partial Specialization Rule: No (single line)

Figure 3-6 Examples of completeness constraints a) Total specialization rule

PATIENT OUT PATIENT RESIDENT PATIENT

Figure 3-6 Examples of completeness constraints (cont.) b) Partial specialization rule

Vehicle Car Instance of Motorcycle Truck

Constraints in Supertype Disjointness Constraints: Whether an instance of a supertype may simultaneously be a member of two (or more) subtypes Disjoint Rule: An instance of the supertype can be only ONE of the subtypes Overlap Rule: An instance of the supertype could be more than one of the subtypes

Figure 3-7 Examples of disjointness constraints a) Disjoint rule

Figure 3-2 Employee supertype with three subtypes All employee subtypes will have employee number, name, address, and date hired Each employee subtype will also have its own attributes d Attributes shared by all employees are associated with EMPLOYEE. Attributes that are peculiar to each subtype are included with that subtype only.

Figure 3-7 Examples of disjointness constraints (cont.) b) Overlap rule

Constraints in Supertype When inserting a new supertype instance, how to determine which subtype(s) should also has corresponding entries (if any)? Subtype Discriminator: An attribute of the supertype whose values determine the target subtype(s) 2 cases: Disjoint rules and Overlap rules

Subtype Discriminator Disjoint subtypes– a simple attribute is added to the supertype with alternative values to indicate the possible subtypes

Figure 3-8 Introducing a subtype discriminator (disjoint rule)

EMPLOYEE HOURLY EMPLOYEE SALARIED EMPLOYEE CONSULTANT

Subtype Discriminator Overlapping subtypes– a composite attribute is added to the supertype. The subparts of this composite attribute pertain to different subtypes. Each subpart contains a Boolean value (Y/N) to indicate whether or not the instance belongs to the associated subtype

Values of the composite attribute

Figure 3-9 Subtype discriminator (overlap rule)

PART MANUFACTURED PART PURCHASED PART

Supertype/subtype hierarchy Supertype/subtype hierarchy is a hierarchical arrangement of supertypes and subtypes, where each subtype has only one supertype. Each subtype may also be a supertype with subtypes

Example: University Most general entity Total specialization rule Common attributes for everyone in this university Overlap rule Subtype of PERSON become suptertype of FACULTY

Business Rule A bank has three types of accounts: checking, saving, and loan. Following are the attributes for each type of account: CHECKING: Acct No, Date Opened, Balance, Services Charge SAVING: Acct No, Date Opened, Balance, Interest Rate, Payment LOAN: Acct No, Date Opened, Balance, Interest Rate, Assume that each bank account must be a member of exactly one of these subtypes.

Each case handled by the firm has a unique case number; a date opened, date closed, and judgment description are also kept on each case. A case is brought by one or more plaintiffs, and the same plaintiff may be involved in many cases. A plaintiff has a requested judgment characteristic. A case is against one or more defendants and the same defendant may be involved in many cases. A plaintiff or defendant may be a person or organization may be a defendant or a plaintiff in cases. In either situation, such legal entities are identified by an entity number, and other attributes are name and net worth.

Each employee has a unique id and is required to store his/her name, date of birth, and skill. An employee may be married to another employee. Each employee may have one or more dependents. Dependents’ name and age are recorded. Dependents’ information does not exist without employees of the dependents. Each employee is supervised by one employee. An employee may supervise at most 10 other employees. An employee can be assigned to one or more projects. Each project is participated by two to five employees. Each project assignment is associated with hours per week the employee need to spend on. Each project is managed by exactly one employee. An employee may manage at most one project.