|
|
|
Forum Newbie
      
Group: General Forum Members
Last Login: Saturday, August 23, 2008 11:59 PM
Points: 8,
Visits: 41
|
|
| I need Sql tables for all countries States and Cities
|
|
|
|
|
SSCrazy
      
Group: General Forum Members
Last Login: Wednesday, April 24, 2013 5:02 AM
Points: 2,365,
Visits: 1,825
|
|
If you mean designing the tables then you may want 3 tables one each for country,state and city. Try designing them and then come to us for doubts/suggestions.
"Keep Trying"
|
|
|
|
|
Forum Newbie
      
Group: General Forum Members
Last Login: Saturday, August 23, 2008 11:59 PM
Points: 8,
Visits: 41
|
|
I need data for all countries and their states and then their cities. I want to build a web form where in dropdown i give user option to select a country then states for that country are loaded then by selecting state he can select the city. I can do that all if i got the data.
List of all countries , states and cities.
|
|
|
|
|
Forum Newbie
      
Group: General Forum Members
Last Login: Tuesday, March 09, 2010 2:32 AM
Points: 1,
Visits: 5
|
|
manaprime (6/10/2008) I need data for all countries and their states and then their cities. I want to build a web form where in dropdown i give user option to select a country then states for that country are loaded then by selecting state he can select the city. I can do that all if i got the data.
Best to have a read about ISO 3166-2 and buy the database. http://www.iso.org/iso/country_codes/iso_3166_databases/iso_3166-2_database.htm and consider which languages these dropdowns will be displayed in for non-english counties.
Also “State” is not the correct heading – they are called subdivisions. Eg: Province, County, island, state, etc
Cities is elsewhere on the web, but I can't remember the link.
|
|
|
|
|
Valued Member
      
Group: General Forum Members
Last Login: Wednesday, September 29, 2010 8:03 PM
Points: 54,
Visits: 1,497
|
|
See also another link http://www.dak-tek.dakotta.com/Country_City_State_List.htm to buy from.
Not all countries use the concept of 'State'. If you are trying to capture an address then you may also need to allow for a ZIP/Postcode column in your database and the format of this varies widely Something like NVARCHAR(20) will probably be ok.
This information also changes from time to time. How will you know when it changes? You might need to think about DateValidFrom and DateValidTo columns to preserve old values.
|
|
|
|
|
Forum Newbie
      
Group: General Forum Members
Last Login: Thursday, December 15, 2011 9:17 PM
Points: 3,
Visits: 31
|
|
http://27.org/isocountrylist/
download the http://27.org/isocountrylist/iso_country_list.sql load into vim editor and save fire this at your sql database and your off
currently looking for regions (subdivisions) and cities sql tables?
|
|
|
|
|
Valued Member
      
Group: General Forum Members
Last Login: Saturday, May 18, 2013 1:47 PM
Points: 51,
Visits: 773
|
|
Free download at the US Census Bureau web site
http://www.census.gov/tiger/tms/gazetteer/places2k.txt
|
|
|
|
|
Forum Newbie
      
Group: General Forum Members
Last Login: Thursday, December 15, 2011 9:17 PM
Points: 3,
Visits: 31
|
|
Thanks for reply. So we have a list of all cities and positional data (guessing) which is helpful.
Not wanting to redo a wheel that must have been done many times before; ER diagramaticaly this is what I am after.
country -< region -< city
http://www.gefeg.com/edifact/d03a/s3/codes/cl1h.htm I now have the ISO regions as per this link with the matching ISO country 2 char code. Which is easy to translate (using vim or your favourite editor) into an SQL table.
Understandably city is a big job and may not exist in 'ISO land'.
|
|
|
|
|
Forum Newbie
      
Group: General Forum Members
Last Login: Thursday, December 15, 2011 9:17 PM
Points: 3,
Visits: 31
|
|
Even better we have ISO related codes down to city level ... and download-able in different formats. http://www.unece.org/cefact/locode/
Same and as MySQL download but regions in 2 char alpha-numerics. http://www.iplocationtools.com/sql_database.php
MySQL download but country -< cities only. http://drupal.org/node/19983
|
|
|
|
|
Forum Newbie
      
Group: General Forum Members
Last Login: Tuesday, July 14, 2009 11:50 PM
Points: 1,
Visits: 0
|
|
|
|
|