I am new to stakoverflow. I have research a lot and I don't think I've found the information I needed. I hope I am not asking something that's been covered already or mixing questions.
I need to collect customer address that service all the world. I looked into few feeds already they helped me a lot but I still need advice. Initially I was going to create a customer table (id, customer_account, name, email) Address table that will contain (id, fk_customer_id,address line1, line2, city,fk_province-id, fk_country_id)
My dilemma is coming from the differences in address structure the world actually have. SO I wanted to ask some specific design and normalization questions.
I am thinking this is what I want customer table (id, customer_account, name, email, country) the country can be used later to improve formatted output in case such thing will be needed in the future (counting on expansion)
as far as the addresses go I have few options that I think I want to consider but not sure which one is best. (all options will use same customer table structure)
1) use a US driven address tables and a none US driven tables
US table will look like US_address(address_id, fk_customer_id,line1,line2,city,fk_state_id,zipcode,fk_type_id)
address table2 (addres_id,fk_customer_id,line1,line2,line3,line4,city,postal,fk_type_id)
the country id will be the deciding factor onto which table I will select or join into US or none US. Note:type_id will tell me if it was a shipping address or billing address or even maybe home, business just as an example
2) use one address table but add a child table to represent lines I like this a lot but it requires join (I don't think join is a bad thing (please correct me if I was wrong) and it will also require the insert to be in a transaction that will insert data to 3 tables like this customer --> get id and insert into address --> get id and insert into lines
design looking like this: address (addres_id,city,province/state, postal_code,address_type) address_lines(address_id,address_line,line_number) this will allow me to have vertical representation of address line vs horizontal representation so instead of having (addres_id,fk_customer_id,line1,line2,line3,line4,city,postal,fk_type_id) with most cases line2, 3 and 4 will be empty, I will add an address line as needed and the join will return all lines for a specific address_id which can give 1,2 or 4 lines
I like 2 and your input is greatly appreciated. I wanted to know what you think of structure, performance, normalization and design ...etc
Also if I pick option 2 is this normalized enough or do I need further normalization. ie the province might have a lot of redundant data should it also be a table?
++++++++++++++++++++++++++ UPDATE ++++++++++++++++++++++++++
The database will serve online users. I don't want to see if I should break out the address into its own table. My main concern is having a solution that is universal for the world. Address format changes from one country to the other one so I wanted a simple solution that is complex enough but not too complicated as I would like it user-friendly too. I would like to break it all up into so many fields but I don't think that solution will make it easy for online forms. I would like input on my current options 1 or 2. the reason I am adding line1, line2, line 3 is to simplify the user interface and while I still serve international users. Users might have to supply floor number or building number but yet I don't have to specify that or ask for specific information. (I am taking into consideration what's popular on the web for online data collection and form formats.)