| | |
Common Phone table serving two other tables
Please support our Database Design advertiser: PostgreSQL or MySQL? Compare and contrast the two most popular open source databases
![]() |
•
•
Join Date: Jan 2009
Posts: 1
Reputation:
Solved Threads: 0
Hi all,
I have a customer table. Each customer can have multiple contacts, as well as multiple phone numbers. Each contact can also have multiple phone numbers.
My design right now is as follows:
customer table:
cust_id
cust_name
cust_address
...
customer contact table
cust_contact_id
cust_id (fk) -> refers to customer table's cust_id
cust_contact_name
...
At this point, I thought of using one phone table to store both customer and contact phone numbers, but I can't figure out how to link them ... A customer can have zero, one or many phone numbers. A contact also can have zero, one or many phone numbers.
Then only way I can think of doing it is by having two phone tables:
customer_phone_table
phone_id
cust_id (fk)
phone
phone_ext
contact_phone_table
phone_id
cust_contact_id (fk)
phone
phone_ext
Is there a better solution that I'm missing?
Thanks
Julio
I have a customer table. Each customer can have multiple contacts, as well as multiple phone numbers. Each contact can also have multiple phone numbers.
My design right now is as follows:
customer table:
cust_id
cust_name
cust_address
...
customer contact table
cust_contact_id
cust_id (fk) -> refers to customer table's cust_id
cust_contact_name
...
At this point, I thought of using one phone table to store both customer and contact phone numbers, but I can't figure out how to link them ... A customer can have zero, one or many phone numbers. A contact also can have zero, one or many phone numbers.
Then only way I can think of doing it is by having two phone tables:
customer_phone_table
phone_id
cust_id (fk)
phone
phone_ext
contact_phone_table
phone_id
cust_contact_id (fk)
phone
phone_ext
Is there a better solution that I'm missing?
Thanks
Julio
I've attached my draft...if anything not clear reply...
BI Developer | LINKdotNET
B.Sc Computer Science, Helwan University
Technical blog | http://ramymahrous.wordpress.com
LinkedIn | http://www.linkedin.com/in/ramymahrous
B.Sc Computer Science, Helwan University
Technical blog | http://ramymahrous.wordpress.com
LinkedIn | http://www.linkedin.com/in/ramymahrous
![]() |
Other Threads in the Database Design Forum
- Previous Thread: Erd problem
- Next Thread: How Many Relationships?
| Thread Tools | Search this Thread |






