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 > customer and invoice address 1:1

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 09-10-03, 17:10
ypx5269 ypx5269 is offline
Registered User
 
Join Date: Sep 2003
Posts: 35
customer and invoice address 1:1

Hi,

I have a CUSTOMER table that has customer name, address, tel etc. The customer address is not the same as the invoice address, but each customer will only have one invoice address, therefore a 1:1 relationship.

Is it correct to put the two addresses in the same table, that is, custName, custAdd, custTel etc., and invName, invAdd, invTel etc. or should this be two tables, if so what are the advantages of this.

Many thanks,

Mark
Reply With Quote
  #2 (permalink)  
Old 09-10-03, 19:47
r937 r937 is offline
SQL Consultant
 
Join Date: Apr 2002
Location: Toronto, Canada
Posts: 19,524
it's pretty much a wash

how often do you run a query that needs customer name plus invoice address (i.e. non-key fields from both tables)? that's how often you do a join, which is less efficient

how many times does the invoice address differ from the physical address (i.e. require a row in the second table)? that's how many "extra" rows you will have

on the other hand, with null fields in one table, you won't really take any "extra" space (except for null bits, which are negligible), and you'll save yourself the bother of doing a join

like i said, it's pretty much a wash, do it whichever way makes sense to you


rudy
http://r937.com/
Reply With Quote
  #3 (permalink)  
Old 09-11-03, 03:15
ypx5269 ypx5269 is offline
Registered User
 
Join Date: Sep 2003
Posts: 35
Thanks

Hi Rudy,

Thanks for the help and advice,

Mark
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