June 23, 2010 at 3:13 am
Hello,
I'm trying to put together a simple conceptual ER model and have a quick question relating to a couple Entities.
The Entities in question are - Organisation, Company and Charity. Business rules dictate that an Organisation can have either a CompanyNumber a CharityNumber, Both or None.
I'm having a few problems (which I’m sure are very basic) in deciding on the best way to represent this.
If anyone has any suggestions, if to just tell me how bad my current solution is then that would be great.
many thanks
June 23, 2010 at 5:41 am
can any Organization have more than one CompanyNumber a CharityNumber?
if the answer is no/never , i'd put those columns in the Organization table; if the answer is maybe/not sure, i'd pull out the relationship similar to what you were doing, but i'd have the table with three columns OrganizationID,CompanyNumberID and CharityNumberID, instead of the way you have CompanyNumber and CharityNumber in a many to many.
actually, to avoid having nulls and updating issues, i'd just have two one-to many relationship tables, one with OrganizationID and CompanyNumberID , and the other with OrganizationID and CharityNumberID
Lowell
June 23, 2010 at 8:26 am
Lowell many thanks for the advice.
An organisation will only ever have a maximum of one of each number. How ever each of the Entitys (company, charity) will have a quite a few unique attributes of their own. Therefore I guess it would be better to split them into three Separate entities (?).
I've defined a 0-1 to 0-1 each of the relationships so hopefully that should model what I need.
If you think I'm on the wrong path then please let me know otherwise many thanks again for the advice.
...EDIT. Going to update the relationship type to not allow NULLs.
Viewing 3 posts - 1 through 2 (of 2 total)
You must be logged in to reply to this topic. Login to reply