We have Ajax based Database for all country, state and city. It's comes with Excel and Mysql. It update per year with free of cost and our script is suitable for all kind of website like Job. A list of cities of each country. Ask Question 25. Has a free list of all the cities in the world, along with their area centroid (lat/lng), as a CSV file. It is compiled from the USGS/GNIS (US) and NGA/GNS (non-US) databases. Country City Population database. Data of GDP values of cities in the world.
Full Database of city state country available in JSON and SQL FormatAll Countries, States & Cities are Covered and Populated with Different Combinations & Versions.
- Countries
countries.json OR countries.sql
- States
states.json OR states.sql
- Cities
cities.json OR cities.sql
- Country + States
countries+states.json OR countries+states.sql
- States + Cities
states+cities.json OR states+cities.sql
- Country + State + Cities
countries+states+cities.json OR countries+states+cities.sql
Note :
Reason behind making this repo. I ran through many websites to get perfect combinations of state, city and countries. Some was with missing states, some with large filesize. So i thought to get it done on my own using PHP Script.
That's all Folks. Enjoy.
Installation
The SQL file includes create statements with indexes, so simply follow the steps below to import the sql file.
Linux/OSX command line:
Windows
- Install 7zip (so you can extract gzip files)
- Extract world.sql.gz and then use the same mysql command lines as Linux above on the
world.sql
file
Data Structure
Countries table
- Size (uncompressed, in database w/ indexes): 32 KB
- 230 records
Column | Type | Description |
---|---|---|
id | SMALLINT(5) UNSIGNED NOT NULL AUTO_INCREMENT | Primary Key for a Country |
name | VARCHAR(255) NOT NULL | Country name |
code | VARCHAR(10) NOT NULL | Country abbreviation |
Regions table (regions/provinces/states)
- Size (uncompressed, in database w/ indexes): 320 KB
- 3,888 records
Column | Type | Description |
---|---|---|
id | INT(11) UNSIGNED NOT NULL AUTO_INCREMENT | Primary Key for a Region |
name | VARCHAR(255) NOT NULL | Region name |
code | VARCHAR(10) NOT NULL | For USA: State/Territory abbreviation |
country_id | SMALLINT(5) UNSIGNED NOT NULL | Foreign key to Countries table |
Cities table
- Size (uncompressed, in database w/ indexes): 272 MB
- 2,790,951 records
All Country State City Database Free Download For Windows
Column | Type | Description |
---|---|---|
id | INT(11) UNSIGNED NOT NULL AUTO_INCREMENT | Primary Key for a City |
name | VARCHAR(255) NOT NULL | City name |
region_id | INT(11) UNSIGNED NOT NULL | Foreign key to Regions table (States for USA) |
country_id | SMALLINT(5) UNSIGNED NOT NULL | Foreign key to Countries table |
latitude | DECIMAL(10,8) NOT NULL | City Latitude |
longitude | DECIMAL(11,8) NOT NULL | City Longitude |
License for MaxMind WorldCities Database
OPEN DATA LICENSE for MaxMind WorldCities and Postal Code Databases
All Country State City Database Free Download Windows 7
Copyright (c) 2008 MaxMind Inc. All Rights Reserved.
All advertising materials and documentation mentioning features or use ofthis database must display the following acknowledgment:'This product includes data created by MaxMind, available fromhttp://www.maxmind.com/'
Redistribution and use with or without modification, are permitted providedthat the following conditions are met:
- Redistributions must retain the above copyright notice, this list ofconditions and the following disclaimer in the documentation and/or othermaterials provided with the distribution.
- All advertising materials and documentation mentioning features or use ofthis database must display the following acknowledgement:'This product includes data created by MaxMind, available fromhttp://www.maxmind.com/'
- 'MaxMind' may not be used to endorse or promote products derived from thisdatabase without specific prior written permission.
THIS DATABASE IS PROVIDED BY MAXMIND.COM ``AS IS' AND ANYEXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIEDWARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE AREDISCLAIMED. IN NO EVENT SHALL MAXMIND.COM BE LIABLE FOR ANYDIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED ANDON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THISDATABASE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.