Draw an EER diagram for the following problem using this textbook’s EER notation, the Visio notation, or the subtypes inside supertypes notation, as specified by your instructor.
A nonprofit organization depends on a number of different types of persons for its successful operation. The organization is interested in the following attributes for all of these persons: SSN, Name, Address, City/State/Zip, and Telephone. Three types of persons are of greatest interest: employees, volunteers, and donors. Employees have only a Date Hired attribute, and volunteers have only a Skill attribute. Donors have only a relationship (named Donates) with an Item entity type. A donor must have donated one or more items, and an item may have no donors, or one or more donors.
There are persons other than employees, volunteers, and donors who are of interest to the organization, so that a person need not belong to any of these three groups. On the other hand, at a given time a person may belong to two or more of these groups (e.g., employee and donor).
The Correct Answer and Explanation is :
To create an Enhanced Entity-Relationship (EER) diagram based on the given problem, we need to represent entities, their attributes, relationships, and any subtypes or supertypes.
EER Diagram Breakdown:
- Person Entity:
The general entity for all persons involved with the nonprofit organization. This will have common attributes shared by all types of persons:
- Attributes: SSN, Name, Address, City/State/Zip, Telephone.
- Subtype Entities (Employee, Volunteer, Donor):
- Employee Entity: An employee has an additional attribute, Date Hired.
- Volunteer Entity: A volunteer has an additional attribute, Skill.
- Donor Entity: Donors have a relationship with the Item entity type, with the relationship named Donates.
- Item Entity: This represents the donated items, which is related to the Donor via the Donates relationship.
- Relationship – Donates:
- This relationship connects Donor to Item. It is a many-to-many relationship, as a donor can donate multiple items, and an item can be donated by multiple donors.
- A donor must donate at least one item, and an item may or may not have any donors.
Handling the Subtypes:
- Subtype Hierarchy:
The entities Employee, Volunteer, and Donor are all subtypes of the Person entity. This means that a person can be classified into any combination of these types (e.g., an employee and a donor). - The notation for this would use the supertype/subtype hierarchy in the diagram, with Person being the supertype and the three subtypes (Employee, Volunteer, Donor).
- The Employee, Volunteer, and Donor entities will each have additional attributes, which are not shared with the other subtypes.
Final Explanation:
- Generalization is used to represent that all persons have common attributes. This helps in avoiding redundancy.
- Specialization is used to create subtypes for Employee, Volunteer, and Donor, each with its unique attributes.
- Relationships are also essential to specify how these entities interact. The Donates relationship is crucial as it defines how donors are related to items.
In summary, the final EER diagram will have:
- A Person supertype with common attributes.
- Three subtypes: Employee, Volunteer, and Donor, each with its specific attributes.
- A Donates relationship between Donor and Item entities.