As E/R diagrams developed it became clear that we needed to have additional types of symbols to represent different types of relationships for object-oriented thinking.  The model became the Enhanced E/R model or EER.

The first type of notation we needed was to be able to diagram supertype/subtype relationships.  A supertype is a generic entity type that has a relationships with one or more related subtypes.  A subtype ia a subgroup of the entities in an entity type that is meaningful to the organization and that shares common attributes or relationships distinct from other subgroups.

An example of supertype/subtype can be with EMPLOYEE (entity).  For instance - we have classifications of HOURLY EMPLOYEE, SALARIED EMPLOYEE, and CONSULTANT EMPLOYEE.  All of the EMPLOYEE types share many common attributes - for instance, Employee_lastname, Employee_firstname, Employee_socsec, Employee_street, Employee_city, etc.  However, if we look at an HOURLY EMPLOYEE type they would have an attribute of Employee_Hourly_Rate that none of the other EMPLOYEE types have.  Similarly, the SALARIED EMPLOYEE would have attributes of Employee_Annual_Salary, Employee_Stock_Option - none of the other types would have these attributes.  The CONSULTANT EMPLOYEE would have as unique attributes Employee_Contract_Number, and Employee_Billing_Rate.  So, we have many shared attributes, but some unique attributes that only certain "types" of EMPLOYEE have.  This is a great time to use the supertype/subtype diagramming on your EER.  EMPLOYEE would be your supertype, and you would have three subtypes - HOURLY EMPLOYEE, SALARIED EMPLOYEE, and CONSULTANT EMPLOYEE.  You can look at your slides to see how to diagram this.

So - you use the supertype/subtype on your EER when either or both of the following apply to the company:

1.  There are attributes that apply to some, but not all, instances of an entity type

2.  The instances of a subtype participate in a relationship unique to that subtype (would have their unique attributes)

For our lab - we have the entity PATIENT.  Do we have types of PATIENT?  How about OUTPATIENT and RESIDENT PATIENT?  Would this possibly be a supertype/subtype?

As we draw our supertype/subtype we use connecting lines with a circle connecting the lower subtypes.  As we are trying to decide whether or not we have supertype/subtype entities - we need to approach the entities we have for our company in one of two ways - through Generalization or Specialization.  Generalization means we start with the normal entity - such as EMPLOYEE and begin listing all of the attributes that we have - if we find that certain attributes ONLY pertain to some types of EMPLOYEE then we probably can identify a supertype/subtype kind of relationships.  So - we redraw our E/R diagram including the new symbols.  Specialization would occur when we are listing our entities - for example, we have an entity - EMPLOYEE and we have another entity - ALUMNUS and another entity STUDENT that we have listed with our business functions of a University.  As we draw our E/R diagram and list the attributes for each of these three entities - we find that we have MANY shared attributes between the three - such as Social_Sec_Num, Lastname, Firstname, Gender, Date_of_Birth, etc.  But, we also find that we have some unique attributes that would only belong to an EMPLOYEE, ALUMNUS or STUDENT.  Such as an attribute for EMPLOYEE would have Salary, Date_hired, while ALUMNUS would have Date_of_Graduation, Degree_type, Degree_major, etc., and STUDENT would have Student_ID.  As we think about our business - the university, we might want to create a brand new supertype - PERSON that would have three subtypes under it.  It would depend on how the business/university operates if this makes sense.

Two other types we have in the new EER are Constraints for our supertype/subtype relationships.  A constraints allow the diagram to capture some of the important business rules that the company operates under.  We will first look at Completeness Constraints.  A completeness constraint is a type of constraint that addresses the question whether an instance of a supertype MUST also be a member of at least one subtype.  The constraint is done through two types - the total specialization rule or the partial specialization rule.  Total specialization rule states that each entity instance of the supertype MUST be a member of some subtype in the relationship.  We show this through using a double line from the supertype to the circle.  The partial specialization rule states that an entity instance of the supertype is allowed NOT to belong to any subtype.  This is done using a single line from the supertype to the circle.

The 2nd type of constraint is the Disjointness constraint.  A disjointness constraint is one that addresses the question whether an instance of a supertyp0e may simultaneously be a member of two (or more) subtypes.  The Disjoint rule specifies that an instance of a supertype MAY NOT simultaneously be a member of two (or more) subtypes.  We put a letter "d" inside the circle to indicate this.  The Overlap rule specifies that an instance of a supertype may simultaneously be a member of two (or more) subtypes).  We put a letter "O" inside the circle.

As you redraw your E/R diagram for Lab 2 - you can decide if you want to use any of the additional EER symbols to better diagram the hospital.  I would look at EMPLOYEE, PHYSICIAN, NURSE, TECHNICIAN, etc.  as possibilities.