Rémy Esmery
Rémy Esmery

Reputation: 768

Stuck on a Database design issue

Say I have the following tables:

My question is : Since a Gear cannot be assigned to more than 1 Member at once, how to make up a relation between Gear and GearAssignation of cardinality 1 to 0..1 ?

At best I managed to do this using a relation between Gear.Id and GearAssignation.GearId, with an unique key (remember it cannot be the PK because of the double PK MemberId/GearTypeId) on GearId. But I'd love to get rid of that UK because my software development tool doesn't recognize it.

As suggested, here is the diagram from SSMS : all irrelevant columns have been deleted

Bringing heavy changes to the current model is not a problem at all for me atm. Suggestions ?

PS : dunno if it helps, I'm using Microsoft's SQL Server 2008

Upvotes: 2

Views: 169

Answers (1)

Jaydee
Jaydee

Reputation: 4158

I'd do this by having a field in Gear for the member_id who it is currently assigned to.

Upvotes: 7

Related Questions