Reputation: 116950
I was looking at ER diagrams today. If we consider two entities, Item and Member in the context of a rental shop, the member can either checkout an item or renew the item. So for this, I came up with the following:
The idea was that a member can check out any number of items but an item can be checked out only once. And, a member can renew any number of items and an item can be renewed by only one member. But my problem is that once a member renews an item, do I need to explicitly indicate it in the ER diagram somehow? I mean, lets say I renew an item, how do I indicate that it should be updated in the CHECKOUT_LOG
table or is it specific only to the relational model?
Upvotes: 0
Views: 409
Reputation: 7586
Have you considered that a renewal and checkout are essentially the same function. From your commentary I see two differences.
As modeled a member can't return an item and then check it out again.
I would model as three entities (primary key in parenthesis.
Item: (Item_id), other fields Member: (User_Id), other fields Checkout: (Item_id, User_Id, Created Timestamp), Return Date, Renewal Indicator
Upvotes: 2