Entity Relationships - Can a weak entity take part in a 'one to many' relationship as the 'one'

cardinality, entity, primary-key, relationship

Solution

You're right, that's not valid - you can't use a to-many relationship as a defining part of a primary key. What you might consider doing instead is adding a unique `loan_id` that you make part of your primary key, instead of the items the loan contains; then a single loan is defined by its customer and loan ID (or customer, date, and loan ID).

If that doesn't work, make `date_leant` a datetime field, and increase the precision on it until you can't possibly (within the constraints of your system) have two loans occur at the same time - how likely is it that a single customer transacts two separate loans within milliseconds of each other?

Note this doesn't prevent the LOAN entity from taking part in the relationship as the "one"; it just means that you can't define the weak entity using the "many".

Problem

With the following entity relationship structure I'm struggling to figure out if the relationship between the LOAN and ITEM entities is valid? The weak entity of LOAN uses a partial key of 'loan_dateLeant' and the primary keys from CUSTOMER and ITEM to form LOANs primary key. However LOAN has a 'one to many' relationship with ITEM as a loan can consist of more than one item. But surely this means that if more than one item is loaned, then the loan record will have two item_id values for part of its primary key?

Original source