If you mean you link table techadress to table domains, and then billing & admin 
adress to techadress, then i think you'r odd..
You should learn some about 'normalization', look for it on the web or in a book.

I'd suggest something like this:


Customer
client_id
clientaddr_id   
..details...

Domains
domain_id
client_id        //references customer
techaddr_id    //references addresses
billaddr_id        // "
adminaddr_id    //   "
name
type
...info...

Adresses
address_id
type
name
addr
city
country
.....etc...

If you'd like to have more than three addresses, you just add an extra table, and skip 
the '..addr_id' 's from domains:

domainaddresses
da_id
domain_id
address_id
type

This table then links the domain to n addresses.

good luck,

rene



----- Original Message ----- 
From: "Kevin O" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Monday, February 05, 2001 6:31 PM
Subject: Setting up data model


> Hello all,
> 
> I've got a few questions about setting up a data model for a database I'm 
> creating.  I want to set it up to be most efficient and would like input 
> from anyone that has the time.
> 
> I'm setting up your basic customer database, except I'd like to allow for a 
> customer within a customer option.  Not everyone will have this, but for 
> those that choose to, it will be available.
> 
> Here is basically what I have:
> 
> 1) I'm a web hosting company and would like for each customer to have the 
> ability to have multiple domains under their account.  (this is the easy 
> part, just a basic customer database)
> 
> 2) Each domain however will need the ability to have up to 3 addresses 
> associated with it.  For example, Administrative, Technical and Billing 
> Contacts.
> 
> Now, the question is how do I set this up to be the most efficient storage 
> of the data?
> 
> My thought is
> 
> Main Customer Table
>       |
>       |
>       ----------------Domain Table
>                            |
>                            |
> TechAddress Table---------- ----------AdminAddress Table
>                            |
>                            |
>                       BillingAddress Table
> 
> Am I way off here?
> 
> I will be checking for things like if each of the addresses being entered 
> are the same as the main address in the main customer table.
> 
> I know this is very confusing.  Can someone please help?
> 
> Thanks,
> Kevin
> [EMAIL PROTECTED]
> 
> 
> 
> 
> 
> 
> _________________________________________________________________
> Get your FREE download of MSN Explorer at http://explorer.msn.com
> 
> 
> ---------------------------------------------------------------------
> Before posting, please check:
>    http://www.mysql.com/manual.php   (the manual)
>    http://lists.mysql.com/           (the list archive)
> 
> To request this thread, e-mail <[EMAIL PROTECTED]>
> To unsubscribe, e-mail <[EMAIL PROTECTED]>
> Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php
> 

Reply via email to