Hello All, I am having some problems modeling a relationship properly and
could use some advice. My final question is at the bottom of this post
(everything else is explanation). Basically what I have is a customer to
our company who can be either an individual or a company, each company may
have many employees (which are really individuals that work-for *or
are-related-to* a company), now for the problem: each individual, company
and company-contact may have multiple contact numbers, how can I stay
normalized and put all those numbers in one table? Ok I'll explain my
structures and relationships:
TABLE RELATIONSHIPS:
=============== =====
* tbl_Customer is a supertype to tbl_Individual and tbl_Company*
tbl_Customer 1:1 tbl_Individual
" " 1:1 tbl_Company
*tbl_CompanyCon atact is a junction table to support the N:N relationship for
company contacts*
tbl_CompanyCont act M:1 tbl_Individual
" " M:1 tbl_Company
TABLE STRUCTURES:
=============== ==
tbl_Customer (super-type table)
CustID - pk
CustType - 'I' or 'C' (to facilitate the sub-type)
tbl_Individual (sub-type table)
cCustID - pk (same as tbl_customer pk)
FirstName - string
LastName - string
tbl_Company (sub-type table)
cCustID - pk (same as tbl_customer pk)
CompanyName - string
Discount - single
tbl_CompanyCont acts (junction table)
IndividualID - composite pk
CompanyID - composite pk
Title - string
Final Structure Note:
Our customer can be either a company or an individual. If its a company
there will/can be many contacts. Contacts are also individuals (so they can
be customers either way). Everyone will have contact numbers (and numbers
will be different when an individual is with a company vs. by themselves)
My Real Question:
how do I add a tbl_ContactNumb ers that can be related to the individual,
company, and companycontact. where I see the problem is my
tbl_CompanyCont acts because it uses a composite key unlike the company or
individual tables so how can I stay normalized and only create one
tbl_ContactNumb ers that I can stuff all three sets of numbers in? Hope I
was clear. Any and all advice is always welcome.
Thanks,
Mike Krous
could use some advice. My final question is at the bottom of this post
(everything else is explanation). Basically what I have is a customer to
our company who can be either an individual or a company, each company may
have many employees (which are really individuals that work-for *or
are-related-to* a company), now for the problem: each individual, company
and company-contact may have multiple contact numbers, how can I stay
normalized and put all those numbers in one table? Ok I'll explain my
structures and relationships:
TABLE RELATIONSHIPS:
=============== =====
* tbl_Customer is a supertype to tbl_Individual and tbl_Company*
tbl_Customer 1:1 tbl_Individual
" " 1:1 tbl_Company
*tbl_CompanyCon atact is a junction table to support the N:N relationship for
company contacts*
tbl_CompanyCont act M:1 tbl_Individual
" " M:1 tbl_Company
TABLE STRUCTURES:
=============== ==
tbl_Customer (super-type table)
CustID - pk
CustType - 'I' or 'C' (to facilitate the sub-type)
tbl_Individual (sub-type table)
cCustID - pk (same as tbl_customer pk)
FirstName - string
LastName - string
tbl_Company (sub-type table)
cCustID - pk (same as tbl_customer pk)
CompanyName - string
Discount - single
tbl_CompanyCont acts (junction table)
IndividualID - composite pk
CompanyID - composite pk
Title - string
Final Structure Note:
Our customer can be either a company or an individual. If its a company
there will/can be many contacts. Contacts are also individuals (so they can
be customers either way). Everyone will have contact numbers (and numbers
will be different when an individual is with a company vs. by themselves)
My Real Question:
how do I add a tbl_ContactNumb ers that can be related to the individual,
company, and companycontact. where I see the problem is my
tbl_CompanyCont acts because it uses a composite key unlike the company or
individual tables so how can I stay normalized and only create one
tbl_ContactNumb ers that I can stuff all three sets of numbers in? Hope I
was clear. Any and all advice is always welcome.
Thanks,
Mike Krous
Comment