Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 General SQL Server Forums
 Database Design and Application Architecture
 Design problems please help

Author  Topic 

dan_n1122
Starting Member

2 Posts

Posted - 2008-02-29 : 20:52:01
Hello All

The website I am working on needs to have more than one address per customer and more then one customer per address. This is like a call center for a commercial solicitation. So here is what I have so far. The clients can enter there info on the website or an employee can enter customers info.

My questions
1 how do I generate a non unique identifier for the same addressIDLink dynamically?

2 Is there a better way to setup this DB?

Thanks for the help

Here is the BD

Table#1
CUstomer
customerID PK
AddressID FK
Name
Phone
email
...

Table 2
Address
AddressID PK
AdressLinkID
COmpany Name
streetAddress
City
...

Table 3
INFO
InfoID PK
EmployeeID FK
ReasonID FK
CustomerID FK
InfoDate
...

Table 4
Reason
ReseaonID PK
QuickReasons
....

Table5
Employee
EmployeeID PK
EmployeeName
....

dan_n1122
Starting Member

2 Posts

Posted - 2008-03-02 : 12:14:18
I guess no one can help or do you guys (and gals:) not understand my question?
Go to Top of Page

dataguru1971
Master Smack Fu Yak Hacker

1464 Posts

Posted - 2008-03-02 : 12:32:32
I am certain we understand the question...but it is far too broad of a topic. Most of us here could probably type all day, or retype information that is readily available on database design basics.

You would have a customer table, with Unique ID's.

You would also have an address table with unique ID's, but it would include the customer ID related to that address (so 1 customer ID in the address table may have 2 or more unique addresses).

You would also have and address TYPE field of some kind (M= Mailing, S= Shipping,B= Billing etc) so that you can easily retrieve the proper address for a customer based on which address you need.

You would also keep unique information associated with a customer, such as "CompanyName"...which can be in your 1 row per customer "Customers" table.

You would put email addresses somewhere in another table, perhaps a Contact table...presumably you would have multiple contacts for each customer...so that table as well would have the customer ID.

Table 2
AddressID PK
CustomerID
streetAddress
City
State
zip
AddressType





Poor planning on your part does not constitute an emergency on my part.

Go to Top of Page
   

- Advertisement -