views:

23

answers:

2

I apologize if this is a duplication.

What column standardization would you use for storing international country subdivision data?

For example, if it was just US and Canada I believe all subdivisions have a 2-character abbreviation... which might lend to a Char(2)

This cannot possibly be sustainable internationally lest we presume there are only 1296 (A-Z, 0-9) subdivisions.

I've been unsuccessful locating an ISO list of these or even an indication of how to store them.

That's fine, I don't need to know them all now but I would like to know that there is a standard and what standard info to store as needed.

Thanks

EDIT: It appears that I can accomplish this using the ISO 3166-2 standard: http://en.wikipedia.org/wiki/ISO_3166-2

Browsable as a dataset here: http://www.commondatahub.com/live/geography/state_province_region/iso_3166_2_state_codes

A: 

Juat for example:

Llanfairpwllgwyngyllgogerychwyrndrobwyll-llantysiliogogogoch This is the name of a town in North Wales.

VARCHAR(100)

Abbreviations: There are 2-letter country code and 3-letter country code which used by UN. You can use VARCHAR(2) for 2-letter code and VARCHAR(3) for 3-letter country code.

E.G. Australia 2-letter, 3-letter and numeric code

AU   AUS   036   Australia

It all depends on how you want to save data. If you want to save 3-letter + numeric code in one column then size will be according to that and if you want to save them separate then size will be different.

To be on safe side you can use VARCHAR(10).

Muhammad Kashif Nadeem
I am not talking about storing town names, or any names for that matter.I'm talking about storing a standardized abbreviation of a country subdivision (such as a state, territory etc)For example: Nevada, USA is "NV"
Matthew PK
You forgot to mention that "Llanfairpwllgwyngyllgogerychwyrndrobwyll-llantysiliogogogoch" is pronounced "huh?" =)
OMG Ponies
"Llanfairpwllgwyngyllgogerychwyrndrobwyll-llantysiliogogogoch" Pronounced: http://en.wikipedia.org/wiki/Llanfairpwllgwyngyll
Muhammad Kashif Nadeem
Your edit only addresses country codes. I am asking about country subdivision codes.
Matthew PK
@Matthew, I think gbn has explained it. In my view following standard is good but in this case you are trying too hard. As I have added a town name in my answer, what would be the abbreviation of this town name?
Muhammad Kashif Nadeem
@Muhammad: I am not referring to town names, solely to larger divisions such as states, provinces, territories, counties etc. If no such abbreviations exist then so be it. However, I was interested in whether or not a standard for storing these exists
Matthew PK
A: 

As far as I know there are no international standards because it's a national issue

Take the UK...

  • Are the sub division Wales, Scotland, England, Northern Ireland? No abbreviations.
  • Counties: is it "Cheshire" ("Ches.") or "Highlands and Islands" (no abbreviations
  • Postal areas: Rutland is still a post county but not an official one

Your question arguably assumes a federal structure (as per Switzerland where I am) but this won't apply to many if most countries. Carrying on with Switzerland, Kanton does not feature in postal addresses or post codes either.

If there is an ISO standard, then national or local pride will annoy punters as soon as it's on your web site.

Personally, I dislike wading through a "state" dropdown on a web site. It has no meaning for me in either UK (my nationality) or my residence (Switzerland).

You may be best to stick states from US and Canada and "non US/Canada". Don't force or assume a sub-division.

gbn
In my particular application I need to track a country subdivision solely for internal purposes. As such, I *could* make up my own numerical scheme and it wouldn't really affect anything but if there *is* some sort of standard I might as well utilize it.
Matthew PK
What if "country subdivisions" don't exist? Malta for example. It's a null concept even used internally.
gbn
If no such subdivisions exist then I can readily leave the field null, I suppose. I did, however, find this site:http://www.commondatahub.com/live/geography/state_province_region/iso_3166_2_state_codesWhat has some sort of abbreviated standard for subdivisions. Now I am searching for the rationale for their definitions.
Matthew PK
....and bingo:http://en.wikipedia.org/wiki/ISO_3166-2So, to answer your question about Malta... They are apparently divided into 68 local counsels:http://en.wikipedia.org/wiki/Local_councils_of_MaltaNow.... whether or not I need to actually store this is another issue.
Matthew PK
I had a look at the commondatahub. Quite amusing for the UK. Use it internally if you want, but you *will* offend people if you expose it or make assumptions.
gbn
Thanks for the warning. I expect to only display the full name of areas and I hope to only require the input if it's required for postal service.
Matthew PK
Matthew PK: sorry, but you're till on sticky ground. In the UK, the legal council entity can be different to the postal one: http://en.wikipedia.org/wiki/Postal_counties_of_the_United_Kingdom
gbn
@gbn: Seems like I'll need to add some custom data depending on the selected country, then. Thanks
Matthew PK