Lec 16
Lec 16
Lec 16
Enhanced ER Diagram
EERM
ENHANCED ENTITY-RELATIONSHIP
MODEL
Extended Entity-Relationship (EER)
3
Model
33
Employee_ID SkILL
111 Leadership
111 Critical thinking
112 Problem solving
Mapping Weak Entities
34
Foreign key
Mapping Relations
Mapping Binary Relationships
38
One-to-One Relationship
•The primary key of one entity type comes the foreign key in the other.
•It does not matter which way around it is done but you should not have a foreign key
in each entity.
Join
Option 2: One relation for each subclass
All attributes are mapped into each subclass.
Hourly_Employee(Employee_number,Employee_Name,Address,
Date_Hired,Hourly_rate)
Salried_Employee(Employee_number,Employee_Name,Address,
Date_Hired,Annual_Salary,Stock_option)
Consultant(Employee_number,Employee_Name,Address,
Date_Hired,Contact_Number,Billing_Rate)
- It works only if the coverage is total and disjoint
- Entities that are not in the subclass are lost
- Overlapping classes cause redundancy
Slide
46
Option 3: One relation for each superclass
All attributes are mapped into each superclass.
Employee(Employee_number,Employee_Name,Address,
Employee_Type,Date_Hired,Hourly_rate,Annual_Salary,Stock_option,Contact_Number,Billi
ng_Rate)
- Many Nulls
- Benefits: No need for joins
Convert the following into Relational Model
Option 1: Employee (SSN, Name), Secretary (SSN, TypingSpeed) and Engineer (SSN, EngType)
Option 2: Secretary (SSN, Name,TypingSpeed) and Engineer (SSN, Name, EngType)
Profession
Option 3: Employee (SSN, Name,TypingSpeed, EngType, Profession)
Are options
Option 4: Employee (SSN, Name,TypingSpeed, EngType, Secretary, Engineer)
Secretary, 3/4 valid for
Engineer
Overlapping?