If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > General > Database Concepts & Design > Help with database design issue

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 09-27-10, 16:09
bjweir bjweir is offline
Registered User
 
Join Date: Jun 2007
Posts: 2
Help with database design issue

Hello All,

I am working on a company service and billing database.

The database has the following tables:
Customers(CustomerID, Account, Name, ...)
Contacts(ContactID, CustomerID, Name, ...)
SendPaths(SendPathID, ContactID, PathTypeID, LookupID, ...)
SendPathTypes(PathTypeID, PathType) -> Phone, Fax, Email, Mail
Addresses(AddressID, CustomerID, Address1, ...)
PhoneFaxNumbers(PhoneID, Type, PhoneNumber)
EMails(EmailID, Address)

A Company can have many Contacts, a contact can have many PhoneNumbers, Emails, Mailing addresses.

Problem: I do not understand how to relate these tables together.
At first I tried using 3 seperate fields in SendPaths (AddressID, PhoneID, EMailID). But I only wanted to use 1 destination for each send path. For example, if the SendPath type is Mail, an invoice would be printed and mailed. A 2nd SendPath for that contact would be to email the invoice to 1 of several possible email addresses. A 3rd SendPath for that contact would be to fax the invoice. With 3 fields in each SendPath only 1 would be used for any given destination (like email).

The second approach I tried was to use a PathTypeID and a generic LookUpID for each SendPath. This is the approach the attached diagram shows. I do not know how to make this solution work using stored proc.

I would like to create a stored proc with parameters like CustomerID, ContactID that would return all the Sendpaths for that Contact.

I am willing to completely start over if needed if anyone has a good approach to solving this problem.

Any help on this would be greatly appreciated!

Thank you
Attached Thumbnails
Help with database design issue-customers-relationships.jpg  
Reply With Quote
  #2 (permalink)  
Old 09-27-10, 18:00
bjweir bjweir is offline
Registered User
 
Join Date: Jun 2007
Posts: 2
This question was answered
08-18-10, 10:33
carlosn
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On