I am working on a web based system. One part will be to store details such as addresses, phone numbers etc. The problem I am having is that different countries have different address formats. Does anyone have any idea how I can handle various country address formats? Do I need to create a different table for each country??
I am not sure but I think adresses are same, there are difference on some countries don`t have State or Postal code formats are differs. Give some example plz.
You'll need fields for building number, street, city, postal code and country. Some countries also have one or two things between city and country, so you can have 2 additional fields called something like sub_1 and sub_2. That should cover all addresses in the world. How you format them if you print them for postal delivery is the problem - there are dozens of formats. It doesn't matter what order the fields sit in the database, but it does matter where they're put on the envelope or mailing label. BTW, none of your fields should be numeric - they're all character fields. (Even the building "number" can be alpha or alphanumeric.)
For example, 123 Apple Road, (Suburb, State, Postcode), (Country) ^ That's how almost every address is presented. So you can have 'Street' (incs unit/house number, street name(incs road/street/place)), 'Suburb', 'State', 'Postcode', 'Country'.