10

Where can I found the list of all the states of world with their country code (ISO2 or ISO3).

I have to insert all these states in my database. If the list is available in the .sql will be great.

I need state list of world with country-code not the country list.

Do you know where can I found?

Thanks in Advance.

Sandip Armal Patil
  • 6,241
  • 21
  • 93
  • 160
Daric
  • 16,229
  • 11
  • 41
  • 58
  • Sorry, If the question make any confusion. I already have countries with ISO code, But I needs state list with ISO code of their country. So that I can insert the states in `state` table and can make reference to `country` table using the ISO code – Daric Jun 02 '11 at 11:18

6 Answers6

4

http://www.timdavis.com.au/data/

There is a link to a excel spreadsheet of all the country and state information.

Payload
  • 1,686
  • 1
  • 10
  • 6
  • It is missing some countryies, it has 202 on it and I am sure there is over 240 on the IOS 3166 list, but this was only source of States I could quickly find on google (it is not my list) – Payload Jun 02 '11 at 12:08
3

This has annoyed me too. My issue is I can never find states to match countries. I created this for people to use. Its in YAML format, I generated python and javascript versions. I also generated an alternate array.

https://github.com/niall-oc/minimax

nialloc
  • 805
  • 7
  • 17
3

Wikipedia has the full list of both 2-letter and 3-letter country codes:

http://en.wikipedia.org/wiki/ISO_3166-1

With regards to having it in a local DB table, note that this list does occasionally change as nations are created, renamed or merged, so although it's not very frequent, you do need to keep it up-to-date, and also importantly, know what you're going to do with codes which become obsolete (ie if you've got cross-references to it from other tables, you can't just delete a record without making the cross-references invalid)

[EDIT]

You comment that you're looking for a state list.

This phrase "state list" is confusing. Are you using the word "state" as its used in the US. Other countries would refer to those as provinces, regions, counties, cantons, or a range of other terms.

More importantly, very few countries have codes for their individual regions.

For example, the UK is broken into counties such as Yorkshire, Hampshire and Surrey, but there aren't any codes that map to these names. There are short abbreviated versions of some of the names (ie 'Hants'=='Hampshire'), but they're colloquial abbreviations; certainly not official. There are also UK postcodes which do provide codes for areas, but these do not map to named counties. And other countries don't even have that.

Spudley
  • 166,037
  • 39
  • 233
  • 307
0

You can get the SQL Scripts from this post: SQL Scripts

Chinjoo
  • 2,697
  • 6
  • 28
  • 45
0

Search google for: php country abbreviations list

Here's the first link: http://27.org/isocountrylist/

Aaria Carter-Weir
  • 1,639
  • 12
  • 17
0

http://www.timdavis.com.au/data/

Interesting data for Country & states. Download excel from here correct the state names and import into your database and use.

Onkar Janwa
  • 3,892
  • 3
  • 31
  • 47