Reputation: 1225
In the following ER diagram, I am supposed to find out the strong and weak entities.
According to me, only PERSON and INSURANCE_COMPANY are strong entities.
PATIENT cannot exist without a doctor (Due to minimum cardinality of 1) hence it is a weak entity. Similarly, STAFF cannot exist without DEPARTMENT and vice versa. Hence, they are both weak entities. Since STAFF is weak, all its subtypes (SUPPORT_STAFF, NURSE, DOCTOR) must also be weak entities, right?
Is my understanding correct or am I missing something?
Upvotes: 0
Views: 4838
Reputation: 10065
Weak entity sets aren't determined by an existence dependency. Regular entity sets can participate totally in a relationship and so have an existence dependency on another entity set too.
What you need to look at is identity. Regular entity sets are identified by their own attributes. Weak entity sets are identified, usually in part, by another entity set.
In your diagram, DEPARTMENT, PERSON, INSURANCE_POLICY and INSURANCE_COMPANY are entity relations describing regular entity sets. Each of these tables have simple primary keys (Dept#, PersonID, Policy# and Co#, if I'm interpreting it correctly, though PKs aren't indicated).
The other tables (STAFF, PATIENT, SUPPORT_STAFF, NURSE, DOCTOR) describe subtypes of Person. Whether these subtypes are weak entity sets is debatable. Chen's original paper, where regular and weak entity sets were described, didn't include the concept of subtypes. Subtypes are subsets, not separate entity sets. However, weak entity sets provided a means of representing subtypes before extended ER notations became available (i.e. weak entity sets without a weak key). In an EER model where subtyping is supported, it may be best to use "weak entity set" to refer only to entity sets whose primary keys consist of a weak key in addition to another entity set's key. The typical example here is line items, which are usually identified by an invoice/receipt number as well as a line number.
In the original ER model, I'd say you have 4 regular entity sets, corresponding to the 4 entity relations DEPARTMENT, PERSON, INSURANCE_POLICY and INSURANCE_COMPANY, and 5 weak entity sets, corresponding to the 5 subtype relations in your diagram. However, in an EER model with a distinct subtype concept, I'd argue that you have 4 regular entity sets and no weak entity sets.
Upvotes: 3