Greetings!
Here's what I'm wanting to do.
Have
tblContacts
- ContactID (Primary Key)
tblCategories
- CatID (Primary Key)
tblSubCategories
- SubCatID (Primary Key)
tblCategoryLink
- ContactID
- CatID
- SubCatID
tblCategoryLink serves as the M:M between tblContacts & tblCategories.
The trouble I'm having is the most elegant solution to keep track of the option sub-category for each category. Each sub-category is linked to a specific category.
Now currently in tblCategoryLink I have:
ContactID
CategoryID
SubCategoryID
Is this the most elegant solution?
It doesn't feel like it for some reason. Mainly because I can't require (in the tables) that the subcategory be a child of the category. In forms I can accomplish this and do a check but that seems like a copout?
I considered having only SubCategoryID and ContactID in the tblCategoryLink but I'm not sure if this would limit the ability to list Contacts by CategoryID and/or SubcategoryID (which are both options I need).
I also considered another M:M to keep track of the SubCategories seperately but that seemed even less elegant.
(Note: I'm not saying is has to be elegant but elegant is usually associated with at least a superficial simplicity which makes it easier to explain to people who are not familiar with the system, i.e. It is simpler to say Contacts can belong to many categories and/or subcategories than to describe many to many tables).
Any help will be appreciated.
Here's what I'm wanting to do.
Have
tblContacts
- ContactID (Primary Key)
tblCategories
- CatID (Primary Key)
tblSubCategories
- SubCatID (Primary Key)
tblCategoryLink
- ContactID
- CatID
- SubCatID
tblCategoryLink serves as the M:M between tblContacts & tblCategories.
The trouble I'm having is the most elegant solution to keep track of the option sub-category for each category. Each sub-category is linked to a specific category.
Now currently in tblCategoryLink I have:
ContactID
CategoryID
SubCategoryID
Is this the most elegant solution?
It doesn't feel like it for some reason. Mainly because I can't require (in the tables) that the subcategory be a child of the category. In forms I can accomplish this and do a check but that seems like a copout?
I considered having only SubCategoryID and ContactID in the tblCategoryLink but I'm not sure if this would limit the ability to list Contacts by CategoryID and/or SubcategoryID (which are both options I need).
I also considered another M:M to keep track of the SubCategories seperately but that seemed even less elegant.
(Note: I'm not saying is has to be elegant but elegant is usually associated with at least a superficial simplicity which makes it easier to explain to people who are not familiar with the system, i.e. It is simpler to say Contacts can belong to many categories and/or subcategories than to describe many to many tables).
Any help will be appreciated.