World Cities/States/Countries SQL & Mysql & Excel Database (September 2023 year) + Website Script (optional)
We Provide Cities / States / Countries database in Microsoft SQL / Oracle / Mysql / Excel formats for use in your applications. All cities / states / countries
have their latitude and longitude filled for display on Google map. For example, on user registration page on your website.
Our downloadable SQL database have details of -
Example of Use (php/jquery script, includes all countries/states/cities) -
Country:
- List of all Countries -
Afghanistan
Aland Islands
Albania
Algeria
American Samoa
Andorra
Angola
Anguilla
Antarctica
Antigua and Barbuda
Argentina
Armenia
Aruba
Australia
Austria
Azerbaijan
Bahamas
Bahrain
Bangladesh
Barbados
Belarus
Belgium
Belize
Benin
Bermuda
Bhutan
Bolivia
Bosnia and Herzegovina
Botswana
Bouvet Island
Brazil
British Indian Ocean Territory
Brunei
Bulgaria
Burkina Faso
Burundi
Cambodia
Cameroon
Canada
Cape Verde
Caribbean Netherlands
Cayman Islands
Central African Republic
Chad
Chile
China
Christmas Island
Cocos (Keeling) Islands
Colombia
Comoros
Congo
Cook Islands
Costa Rica
Côte d’Ivoire
Croatia
Cuba
Curacao
Cyberbunker
Cyprus
Czech Republic
Denmark
Djibouti
Dominica
Dominican Republic
DR Congo
East Timor
Ecuador
Egypt
El Salvador
Equatorial Guinea
Eritrea
Estonia
Ethiopia
European Union
Falkland Islands
Faroe Islands
Fiji Islands
Finland
France
French Guiana
French Polynesia
French Southern territories
Gabon
Gambia
Georgia
Germany
Ghana
Gibraltar
Greece
Greenland
Grenada
Guadeloupe
Guam
Guatemala
Guernsey
Guinea
Guinea-Bissau
Guyana
Haiti
Heard Island and McDonald…
Honduras
Hong Kong
Hungary
Iceland
India
Indonesia
Iran
Iraq
Ireland
Isle of Man
Israel
Italy
Jamaica
Japan
Jersey
Jordan
Kazakstan
Kenya
Kiribati
Kosovo
Kuwait
Kyrgyzstan
Laos
Latvia
Lebanon
Lesotho
Liberia
Libya
Liechtenstein
Lithuania
Luxembourg
Macao
Madagascar
Malawi
Malaysia
Maldives
Mali
Malta
Marshall Islands
Martinique
Mauritania
Mauritius
Mayotte
Mexico
Micronesia, Federated States
Moldova
Monaco
Mongolia
Montenegro
Montserrat
Morocco
Mozambique
Myanmar
Namibia
Nauru
Nepal
Netherlands
Netherlands Antilles
New Caledonia
New Zealand
Nicaragua
Niger
Nigeria
Niue
Norfolk Island
North Korea
North Macedonia
Northern Mariana Islands
Norway
Oman
Pakistan
Palau
Palestine
Panama
Papua New Guinea
Paraguay
Peru
Philippines
Pitcairn
Poland
Portugal
Puerto Rico
Qatar
Réunion
Romania
Russia
Rwanda
Saint Barthelemy
Saint Helena
Saint Kitts and Nevis
Saint Lucia
Saint Martin
Saint Pierre and Miquelon
Saint Vincent and the Grenadines
Samoa
San Marino
Sao Tome and Principe
Saudi Arabia
Senegal
Serbia
Seychelles
Sierra Leone
Singapore
Sint Maarten
Slovakia
Slovenia
Solomon Islands
Somalia
South Africa
South Georgia and the South…
South Korea
South Sudan
Spain
Sri Lanka
Sudan
Suriname
Svalbard and Jan Mayen
Swaziland
Sweden
Switzerland
Syria
Taiwan
Tajikistan
Tanzania
Thailand
Togo
Tokelau
Tonga
Trinidad and Tobago
Tunisia
Turkey
Turkmenistan
Turks and Caicos Islands
Tuvalu
Uganda
Ukraine
United Arab Emirates
United Kingdom
United States Minor Outlying…
Uruguay
USA
Uzbekistan
Vanuatu
Vatican (Holy See)
Venezuela
Vietnam
Virgin Islands, British
Virgin Islands, U.S.
Wallis and Futuna
Western Sahara
Yemen
Zambia
Zimbabwe
States:
- Select One -
Cities:
- Select One -
We tested cities database on Mysql / Oracle / Microsoft SQL Server. Cities SQL Demo has the same table structure as the full version. But it only has 5 selected countries (USA/China/France/Brazil/India), all states for those selected countries and limit 5 cities records for each state. Complete list of cities you can see in the example above or by using this
link .
Price for the full version (Cities/States/Countries SQL & MySQL Database) is US$249 / 0.01 Bitcoin
Price for the PHP Script is FREE (with Cities SQL & MySQL Database). Limited Time Offer . Normal Price is US$50. Cities PHP Script for Website compatible with MySQL only (not MSSQL). It uses Php / Mysql / Jquery / Html and displays countries/states/cities drop-down ajax list in the same way as you see in our example above.
Price for the full version (Cities/States/Countries MySQL Database) + Complete Script for Website (Php/Mysql/Jquery/Html) is US$249 / 0.01 Bitcoin (Limited Time Offer). Normal Price is $299.
License - Our cities database is licensed under the GNU general public license which means it may be used by our customers on as many websites as they like.
A. Cities in Excel Format -
B. Cities in SQL / MySQL Format (truncated) -
/*************************************************************/;
/* A. CREATE TABLE STATEMENT - Microsoft SQL Server / Oracle */;
/*************************************************************/;
/************************************/;
/* COUNTRIES SQL Table 253 records */;
/************************************/;
CREATE TABLE countries (
countryID varchar(3) NOT NULL,
countryName nvarchar(100) NOT NULL,
localName nvarchar(100),
webCode varchar(2),
region varchar(50),
continent varchar(25),
latitude float NOT NULL,
longitude float NOT NULL,
surfaceArea float NOT NULL,
population int NOT NULL,
PRIMARY KEY (countryID),
UNIQUE (webCode),
UNIQUE (countryName)
);
/************************************/;
/* STATES SQL Table ~4,480 records */;
/************************************/;
CREATE TABLE states (
stateID int NOT NULL,
stateName nvarchar(100) NOT NULL,
countryID varchar(3) NOT NULL,
latitude float NOT NULL,
longitude float NOT NULL,
PRIMARY KEY (stateID),
UNIQUE (countryID, stateName)
);
/*************************************/;
/* CITIES SQL Table ~176,000 records */;
/*************************************/;
CREATE TABLE cities (
cityID int NOT NULL,
cityName nvarchar(100) NOT NULL,
stateID int NOT NULL,
countryID varchar(3) NOT NULL,
latitude float NOT NULL,
longitude float NOT NULL,
PRIMARY KEY (cityID),
UNIQUE (countryID,stateID,cityID)
);
/*************************************************************/;
/* B. CREATE TABLE STATEMENT - MySQL Server */;
/*************************************************************/;
/***************************************/;
/* COUNTRIES MySQL Table 253 records */;
/***************************************/;
CREATE TABLE `countries` (
`countryID` varchar(3) NOT NULL DEFAULT '',
`countryName` varchar(52) NOT NULL DEFAULT '',
`localName` varchar(45) NOT NULL,
`webCode` varchar(2) NOT NULL,
`region` varchar(26) NOT NULL,
`continent` enum('Asia','Europe','North America','Africa','Oceania','Antarctica','South America') NOT NULL,
`latitude` double NOT NULL DEFAULT '0',
`longitude` double NOT NULL DEFAULT '0',
`surfaceArea` float(10,2) NOT NULL DEFAULT '0.00',
`population` int(11) NOT NULL DEFAULT '0',
PRIMARY KEY (`countryID`),
UNIQUE KEY `webCode` (`webCode`),
UNIQUE KEY `countryName` (`countryName`),
KEY `region` (`region`),
KEY `continent` (`continent`),
KEY `surfaceArea` (`surfaceArea`),
KEY `population` (`population`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
/**************************************/;
/* STATES MySQL Table ~2,800 records */;
/**************************************/;
CREATE TABLE `states` (
`stateID` smallint(5) unsigned NOT NULL AUTO_INCREMENT,
`stateName` varchar(50) NOT NULL DEFAULT '',
`countryID` varchar(3) NOT NULL,
`latitude` double NOT NULL DEFAULT '0',
`longitude` double NOT NULL DEFAULT '0',
PRIMARY KEY (`stateID`),
KEY `stateName` (`stateName`),
KEY `countryID` (`countryID`),
KEY `unq` (`countryID`,`stateName`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
/***************************************/;
/* CITIES MySQL Table ~176,000 records */;
/***************************************/;
CREATE TABLE `cities` (
`cityID` mediumint(8) unsigned NOT NULL AUTO_INCREMENT,
`cityName` varchar(50) NOT NULL,
`stateID` smallint(5) unsigned NOT NULL DEFAULT '0',
`countryID` varchar(3) NOT NULL DEFAULT '',
`latitude` double NOT NULL DEFAULT '0',
`longitude` double NOT NULL DEFAULT '0',
PRIMARY KEY (`cityID`),
UNIQUE KEY `unq` (`countryID`,`stateID`,`cityID`),
KEY `cityName` (`cityName`),
KEY `stateID` (`stateID`),
KEY `countryID` (`countryID`),
KEY `latitude` (`latitude`),
KEY `longitude` (`longitude`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
/***************************************/;
/*************************************************************/;
/* C. Microsoft SQL/Oracle/MySQL Common Table Data */;
/*************************************************************/;
/* Countries Table Data */
INSERT INTO `countries` (`countryID`, `countryName`, `localName`, `webCode`, `region`, `continent`,
`latitude`, `longitude`, `surfaceArea`, `population`) VALUES
('BRA', 'Brazil', 'Brasil', 'BR', 'South America', 'South America', -10, -55, 8547403.00, 170115000),
('CHN', 'China', 'Zhongquo', 'CN', 'Eastern Asia', 'Asia', 35, 105, 9572900.00, 1277558000),
('FRA', 'France', 'France', 'FR', 'Western Europe', 'Europe', 47, 2, 551500.00, 59225700),
('IND', 'India', 'Bharat/India', 'IN', 'Southern and Central Asia', 'Asia', 28.47, 77.03, 3287263.00, 1013662000),
('USA', 'USA', 'United States', 'US', 'North America', 'North America', 38, -97, 9363520.00, 278357000);
/* States Table Data */
INSERT INTO `states` (`stateID`, `stateName`, `countryID`, `latitude`, `longitude`) VALUES
(5, 'California', 'USA', 37.42, -122.06),
(6, 'Beijing', 'CHN', 39.93, 116.39),
(9, 'Iowa', 'USA', 43.03, -96.09),
(10, 'New York', 'USA', 40.76, -73.97),
(12, '... ....', 'CHN', 32.06, 118.78);
/* Cities Table Data */
INSERT INTO `cities` (`cityID`, `cityName`, `stateID`, `countryID`, `latitude`, `longitude`) VALUES
(7, 'Mountain View', 5, 'USA', 37.42, -122.06),
(8, 'Beijing', 6, 'CHN', 39.93, 116.39),
(11, 'Ackworth', 9, 'USA', 41.36, -93.43),
(13, 'Far Rockaway', 10, 'USA', 40.61, -73.79),
(14, 'Hebei', 11, 'CHN', 39.89, 115.28),
(15, 'Los Angeles', 5, 'USA', 34.04, -118.25),
(16, '... ... ...', 12, 'CHN', 32.06, 118.78);
Full Cities/States/Countries MySQL & Sql source code you can download here »