New Database design
I'm setting up a new database for our e-commerce site. I'm unsure on what the best approach would be on setting up billto and shipto address data for a customer and for an order. i'm thinking in some cases the customer address may differ in an order. Should the address data be in a separate table (addresses) so that the address_id will be associated with a customer and orders? I'm thinking this may be the best approach. Any thoughts will be appreciated.
no, don't bother
the only reason you'd want to store addresses in and of themselves is if you cared about them as addresses, independent of whether any customer had those addresses
for instance, the post office needs to know about an address regardless of who lives there
if you're just tracking customers and orders, then address is a non-key attribute, and should be stored as data, not as a keyed relationship to another table
the amount of duplication is likely miniscule anyway, so you won't even be saving space (and disk space is the cheapest thing you have to worry about)
ok, makes sense thanks for your help