Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Sql dump of all the Countries, Country Codes, Phone codes.
CREATE TABLE IF NOT EXISTS `country` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`iso` char(2) NOT NULL,
`name` varchar(80) NOT NULL,
`nicename` varchar(80) NOT NULL,
`iso3` char(3) DEFAULT NULL,
`numcode` smallint(6) DEFAULT NULL,
`phonecode` int(5) NOT NULL,
PRIMARY KEY (`id`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1;
--
-- Dumping data for table `country`
--
INSERT INTO `country` (`id`, `iso`, `name`, `nicename`, `iso3`, `numcode`, `phonecode`) VALUES
(1, 'AF', 'AFGHANISTAN', 'Afghanistan', 'AFG', 4, 93),
(2, 'AL', 'ALBANIA', 'Albania', 'ALB', 8, 355),
(3, 'DZ', 'ALGERIA', 'Algeria', 'DZA', 12, 213),
(4, 'AS', 'AMERICAN SAMOA', 'American Samoa', 'ASM', 16, 1684),
(5, 'AD', 'ANDORRA', 'Andorra', 'AND', 20, 376),
(6, 'AO', 'ANGOLA', 'Angola', 'AGO', 24, 244),
(7, 'AI', 'ANGUILLA', 'Anguilla', 'AIA', 660, 1264),
(8, 'AQ', 'ANTARCTICA', 'Antarctica', NULL, NULL, 0),
(9, 'AG', 'ANTIGUA AND BARBUDA', 'Antigua and Barbuda', 'ATG', 28, 1268),
(10, 'AR', 'ARGENTINA', 'Argentina', 'ARG', 32, 54),
(11, 'AM', 'ARMENIA', 'Armenia', 'ARM', 51, 374),
(12, 'AW', 'ARUBA', 'Aruba', 'ABW', 533, 297),
(13, 'AU', 'AUSTRALIA', 'Australia', 'AUS', 36, 61),
(14, 'AT', 'AUSTRIA', 'Austria', 'AUT', 40, 43),
(15, 'AZ', 'AZERBAIJAN', 'Azerbaijan', 'AZE', 31, 994),
(16, 'BS', 'BAHAMAS', 'Bahamas', 'BHS', 44, 1242),
(17, 'BH', 'BAHRAIN', 'Bahrain', 'BHR', 48, 973),
(18, 'BD', 'BANGLADESH', 'Bangladesh', 'BGD', 50, 880),
(19, 'BB', 'BARBADOS', 'Barbados', 'BRB', 52, 1246),
(20, 'BY', 'BELARUS', 'Belarus', 'BLR', 112, 375),
(21, 'BE', 'BELGIUM', 'Belgium', 'BEL', 56, 32),
(22, 'BZ', 'BELIZE', 'Belize', 'BLZ', 84, 501),
(23, 'BJ', 'BENIN', 'Benin', 'BEN', 204, 229),
(24, 'BM', 'BERMUDA', 'Bermuda', 'BMU', 60, 1441),
(25, 'BT', 'BHUTAN', 'Bhutan', 'BTN', 64, 975),
(26, 'BO', 'BOLIVIA', 'Bolivia', 'BOL', 68, 591),
(27, 'BA', 'BOSNIA AND HERZEGOVINA', 'Bosnia and Herzegovina', 'BIH', 70, 387),
(28, 'BW', 'BOTSWANA', 'Botswana', 'BWA', 72, 267),
(29, 'BV', 'BOUVET ISLAND', 'Bouvet Island', NULL, NULL, 0),
(30, 'BR', 'BRAZIL', 'Brazil', 'BRA', 76, 55),
(31, 'IO', 'BRITISH INDIAN OCEAN TERRITORY', 'British Indian Ocean Territory', NULL, NULL, 246),
(32, 'BN', 'BRUNEI DARUSSALAM', 'Brunei Darussalam', 'BRN', 96, 673),
(33, 'BG', 'BULGARIA', 'Bulgaria', 'BGR', 100, 359),
(34, 'BF', 'BURKINA FASO', 'Burkina Faso', 'BFA', 854, 226),
(35, 'BI', 'BURUNDI', 'Burundi', 'BDI', 108, 257),
(36, 'KH', 'CAMBODIA', 'Cambodia', 'KHM', 116, 855),
(37, 'CM', 'CAMEROON', 'Cameroon', 'CMR', 120, 237),
(38, 'CA', 'CANADA', 'Canada', 'CAN', 124, 1),
(39, 'CV', 'CAPE VERDE', 'Cape Verde', 'CPV', 132, 238),
(40, 'KY', 'CAYMAN ISLANDS', 'Cayman Islands', 'CYM', 136, 1345),
(41, 'CF', 'CENTRAL AFRICAN REPUBLIC', 'Central African Republic', 'CAF', 140, 236),
(42, 'TD', 'CHAD', 'Chad', 'TCD', 148, 235),
(43, 'CL', 'CHILE', 'Chile', 'CHL', 152, 56),
(44, 'CN', 'CHINA', 'China', 'CHN', 156, 86),
(45, 'CX', 'CHRISTMAS ISLAND', 'Christmas Island', NULL, NULL, 61),
(46, 'CC', 'COCOS (KEELING) ISLANDS', 'Cocos (Keeling) Islands', NULL, NULL, 672),
(47, 'CO', 'COLOMBIA', 'Colombia', 'COL', 170, 57),
(48, 'KM', 'COMOROS', 'Comoros', 'COM', 174, 269),
(49, 'CG', 'CONGO', 'Congo', 'COG', 178, 242),
(50, 'CD', 'CONGO, THE DEMOCRATIC REPUBLIC OF THE', 'Congo, the Democratic Republic of the', 'COD', 180, 242),
(51, 'CK', 'COOK ISLANDS', 'Cook Islands', 'COK', 184, 682),
(52, 'CR', 'COSTA RICA', 'Costa Rica', 'CRI', 188, 506),
(53, 'CI', 'COTE D''IVOIRE', 'Cote D''Ivoire', 'CIV', 384, 225),
(54, 'HR', 'CROATIA', 'Croatia', 'HRV', 191, 385),
(55, 'CU', 'CUBA', 'Cuba', 'CUB', 192, 53),
(56, 'CY', 'CYPRUS', 'Cyprus', 'CYP', 196, 357),
(57, 'CZ', 'CZECH REPUBLIC', 'Czech Republic', 'CZE', 203, 420),
(58, 'DK', 'DENMARK', 'Denmark', 'DNK', 208, 45),
(59, 'DJ', 'DJIBOUTI', 'Djibouti', 'DJI', 262, 253),
(60, 'DM', 'DOMINICA', 'Dominica', 'DMA', 212, 1767),
(61, 'DO', 'DOMINICAN REPUBLIC', 'Dominican Republic', 'DOM', 214, 1809),
(62, 'EC', 'ECUADOR', 'Ecuador', 'ECU', 218, 593),
(63, 'EG', 'EGYPT', 'Egypt', 'EGY', 818, 20),
(64, 'SV', 'EL SALVADOR', 'El Salvador', 'SLV', 222, 503),
(65, 'GQ', 'EQUATORIAL GUINEA', 'Equatorial Guinea', 'GNQ', 226, 240),
(66, 'ER', 'ERITREA', 'Eritrea', 'ERI', 232, 291),
(67, 'EE', 'ESTONIA', 'Estonia', 'EST', 233, 372),
(68, 'ET', 'ETHIOPIA', 'Ethiopia', 'ETH', 231, 251),
(69, 'FK', 'FALKLAND ISLANDS (MALVINAS)', 'Falkland Islands (Malvinas)', 'FLK', 238, 500),
(70, 'FO', 'FAROE ISLANDS', 'Faroe Islands', 'FRO', 234, 298),
(71, 'FJ', 'FIJI', 'Fiji', 'FJI', 242, 679),
(72, 'FI', 'FINLAND', 'Finland', 'FIN', 246, 358),
(73, 'FR', 'FRANCE', 'France', 'FRA', 250, 33),
(74, 'GF', 'FRENCH GUIANA', 'French Guiana', 'GUF', 254, 594),
(75, 'PF', 'FRENCH POLYNESIA', 'French Polynesia', 'PYF', 258, 689),
(76, 'TF', 'FRENCH SOUTHERN TERRITORIES', 'French Southern Territories', NULL, NULL, 0),
(77, 'GA', 'GABON', 'Gabon', 'GAB', 266, 241),
(78, 'GM', 'GAMBIA', 'Gambia', 'GMB', 270, 220),
(79, 'GE', 'GEORGIA', 'Georgia', 'GEO', 268, 995),
(80, 'DE', 'GERMANY', 'Germany', 'DEU', 276, 49),
(81, 'GH', 'GHANA', 'Ghana', 'GHA', 288, 233),
(82, 'GI', 'GIBRALTAR', 'Gibraltar', 'GIB', 292, 350),
(83, 'GR', 'GREECE', 'Greece', 'GRC', 300, 30),
(84, 'GL', 'GREENLAND', 'Greenland', 'GRL', 304, 299),
(85, 'GD', 'GRENADA', 'Grenada', 'GRD', 308, 1473),
(86, 'GP', 'GUADELOUPE', 'Guadeloupe', 'GLP', 312, 590),
(87, 'GU', 'GUAM', 'Guam', 'GUM', 316, 1671),
(88, 'GT', 'GUATEMALA', 'Guatemala', 'GTM', 320, 502),
(89, 'GN', 'GUINEA', 'Guinea', 'GIN', 324, 224),
(90, 'GW', 'GUINEA-BISSAU', 'Guinea-Bissau', 'GNB', 624, 245),
(91, 'GY', 'GUYANA', 'Guyana', 'GUY', 328, 592),
(92, 'HT', 'HAITI', 'Haiti', 'HTI', 332, 509),
(93, 'HM', 'HEARD ISLAND AND MCDONALD ISLANDS', 'Heard Island and Mcdonald Islands', NULL, NULL, 0),
(94, 'VA', 'HOLY SEE (VATICAN CITY STATE)', 'Holy See (Vatican City State)', 'VAT', 336, 39),
(95, 'HN', 'HONDURAS', 'Honduras', 'HND', 340, 504),
(96, 'HK', 'HONG KONG', 'Hong Kong', 'HKG', 344, 852),
(97, 'HU', 'HUNGARY', 'Hungary', 'HUN', 348, 36),
(98, 'IS', 'ICELAND', 'Iceland', 'ISL', 352, 354),
(99, 'IN', 'INDIA', 'India', 'IND', 356, 91),
(100, 'ID', 'INDONESIA', 'Indonesia', 'IDN', 360, 62),
(101, 'IR', 'IRAN, ISLAMIC REPUBLIC OF', 'Iran, Islamic Republic of', 'IRN', 364, 98),
(102, 'IQ', 'IRAQ', 'Iraq', 'IRQ', 368, 964),
(103, 'IE', 'IRELAND', 'Ireland', 'IRL', 372, 353),
(104, 'IL', 'ISRAEL', 'Israel', 'ISR', 376, 972),
(105, 'IT', 'ITALY', 'Italy', 'ITA', 380, 39),
(106, 'JM', 'JAMAICA', 'Jamaica', 'JAM', 388, 1876),
(107, 'JP', 'JAPAN', 'Japan', 'JPN', 392, 81),
(108, 'JO', 'JORDAN', 'Jordan', 'JOR', 400, 962),
(109, 'KZ', 'KAZAKHSTAN', 'Kazakhstan', 'KAZ', 398, 7),
(110, 'KE', 'KENYA', 'Kenya', 'KEN', 404, 254),
(111, 'KI', 'KIRIBATI', 'Kiribati', 'KIR', 296, 686),
(112, 'KP', 'KOREA, DEMOCRATIC PEOPLE''S REPUBLIC OF', 'Korea, Democratic People''s Republic of', 'PRK', 408, 850),
(113, 'KR', 'KOREA, REPUBLIC OF', 'Korea, Republic of', 'KOR', 410, 82),
(114, 'KW', 'KUWAIT', 'Kuwait', 'KWT', 414, 965),
(115, 'KG', 'KYRGYZSTAN', 'Kyrgyzstan', 'KGZ', 417, 996),
(116, 'LA', 'LAO PEOPLE''S DEMOCRATIC REPUBLIC', 'Lao People''s Democratic Republic', 'LAO', 418, 856),
(117, 'LV', 'LATVIA', 'Latvia', 'LVA', 428, 371),
(118, 'LB', 'LEBANON', 'Lebanon', 'LBN', 422, 961),
(119, 'LS', 'LESOTHO', 'Lesotho', 'LSO', 426, 266),
(120, 'LR', 'LIBERIA', 'Liberia', 'LBR', 430, 231),
(121, 'LY', 'LIBYAN ARAB JAMAHIRIYA', 'Libyan Arab Jamahiriya', 'LBY', 434, 218),
(122, 'LI', 'LIECHTENSTEIN', 'Liechtenstein', 'LIE', 438, 423),
(123, 'LT', 'LITHUANIA', 'Lithuania', 'LTU', 440, 370),
(124, 'LU', 'LUXEMBOURG', 'Luxembourg', 'LUX', 442, 352),
(125, 'MO', 'MACAO', 'Macao', 'MAC', 446, 853),
(126, 'MK', 'MACEDONIA, THE FORMER YUGOSLAV REPUBLIC OF', 'Macedonia, the Former Yugoslav Republic of', 'MKD', 807, 389),
(127, 'MG', 'MADAGASCAR', 'Madagascar', 'MDG', 450, 261),
(128, 'MW', 'MALAWI', 'Malawi', 'MWI', 454, 265),
(129, 'MY', 'MALAYSIA', 'Malaysia', 'MYS', 458, 60),
(130, 'MV', 'MALDIVES', 'Maldives', 'MDV', 462, 960),
(131, 'ML', 'MALI', 'Mali', 'MLI', 466, 223),
(132, 'MT', 'MALTA', 'Malta', 'MLT', 470, 356),
(133, 'MH', 'MARSHALL ISLANDS', 'Marshall Islands', 'MHL', 584, 692),
(134, 'MQ', 'MARTINIQUE', 'Martinique', 'MTQ', 474, 596),
(135, 'MR', 'MAURITANIA', 'Mauritania', 'MRT', 478, 222),
(136, 'MU', 'MAURITIUS', 'Mauritius', 'MUS', 480, 230),
(137, 'YT', 'MAYOTTE', 'Mayotte', NULL, NULL, 269),
(138, 'MX', 'MEXICO', 'Mexico', 'MEX', 484, 52),
(139, 'FM', 'MICRONESIA, FEDERATED STATES OF', 'Micronesia, Federated States of', 'FSM', 583, 691),
(140, 'MD', 'MOLDOVA, REPUBLIC OF', 'Moldova, Republic of', 'MDA', 498, 373),
(141, 'MC', 'MONACO', 'Monaco', 'MCO', 492, 377),
(142, 'MN', 'MONGOLIA', 'Mongolia', 'MNG', 496, 976),
(143, 'MS', 'MONTSERRAT', 'Montserrat', 'MSR', 500, 1664),
(144, 'MA', 'MOROCCO', 'Morocco', 'MAR', 504, 212),
(145, 'MZ', 'MOZAMBIQUE', 'Mozambique', 'MOZ', 508, 258),
(146, 'MM', 'MYANMAR', 'Myanmar', 'MMR', 104, 95),
(147, 'NA', 'NAMIBIA', 'Namibia', 'NAM', 516, 264),
(148, 'NR', 'NAURU', 'Nauru', 'NRU', 520, 674),
(149, 'NP', 'NEPAL', 'Nepal', 'NPL', 524, 977),
(150, 'NL', 'NETHERLANDS', 'Netherlands', 'NLD', 528, 31),
(151, 'AN', 'NETHERLANDS ANTILLES', 'Netherlands Antilles', 'ANT', 530, 599),
(152, 'NC', 'NEW CALEDONIA', 'New Caledonia', 'NCL', 540, 687),
(153, 'NZ', 'NEW ZEALAND', 'New Zealand', 'NZL', 554, 64),
(154, 'NI', 'NICARAGUA', 'Nicaragua', 'NIC', 558, 505),
(155, 'NE', 'NIGER', 'Niger', 'NER', 562, 227),
(156, 'NG', 'NIGERIA', 'Nigeria', 'NGA', 566, 234),
(157, 'NU', 'NIUE', 'Niue', 'NIU', 570, 683),
(158, 'NF', 'NORFOLK ISLAND', 'Norfolk Island', 'NFK', 574, 672),
(159, 'MP', 'NORTHERN MARIANA ISLANDS', 'Northern Mariana Islands', 'MNP', 580, 1670),
(160, 'NO', 'NORWAY', 'Norway', 'NOR', 578, 47),
(161, 'OM', 'OMAN', 'Oman', 'OMN', 512, 968),
(162, 'PK', 'PAKISTAN', 'Pakistan', 'PAK', 586, 92),
(163, 'PW', 'PALAU', 'Palau', 'PLW', 585, 680),
(164, 'PS', 'PALESTINIAN TERRITORY, OCCUPIED', 'Palestinian Territory, Occupied', NULL, NULL, 970),
(165, 'PA', 'PANAMA', 'Panama', 'PAN', 591, 507),
(166, 'PG', 'PAPUA NEW GUINEA', 'Papua New Guinea', 'PNG', 598, 675),
(167, 'PY', 'PARAGUAY', 'Paraguay', 'PRY', 600, 595),
(168, 'PE', 'PERU', 'Peru', 'PER', 604, 51),
(169, 'PH', 'PHILIPPINES', 'Philippines', 'PHL', 608, 63),
(170, 'PN', 'PITCAIRN', 'Pitcairn', 'PCN', 612, 0),
(171, 'PL', 'POLAND', 'Poland', 'POL', 616, 48),
(172, 'PT', 'PORTUGAL', 'Portugal', 'PRT', 620, 351),
(173, 'PR', 'PUERTO RICO', 'Puerto Rico', 'PRI', 630, 1787),
(174, 'QA', 'QATAR', 'Qatar', 'QAT', 634, 974),
(175, 'RE', 'REUNION', 'Reunion', 'REU', 638, 262),
(176, 'RO', 'ROMANIA', 'Romania', 'ROM', 642, 40),
(177, 'RU', 'RUSSIAN FEDERATION', 'Russian Federation', 'RUS', 643, 70),
(178, 'RW', 'RWANDA', 'Rwanda', 'RWA', 646, 250),
(179, 'SH', 'SAINT HELENA', 'Saint Helena', 'SHN', 654, 290),
(180, 'KN', 'SAINT KITTS AND NEVIS', 'Saint Kitts and Nevis', 'KNA', 659, 1869),
(181, 'LC', 'SAINT LUCIA', 'Saint Lucia', 'LCA', 662, 1758),
(182, 'PM', 'SAINT PIERRE AND MIQUELON', 'Saint Pierre and Miquelon', 'SPM', 666, 508),
(183, 'VC', 'SAINT VINCENT AND THE GRENADINES', 'Saint Vincent and the Grenadines', 'VCT', 670, 1784),
(184, 'WS', 'SAMOA', 'Samoa', 'WSM', 882, 684),
(185, 'SM', 'SAN MARINO', 'San Marino', 'SMR', 674, 378),
(186, 'ST', 'SAO TOME AND PRINCIPE', 'Sao Tome and Principe', 'STP', 678, 239),
(187, 'SA', 'SAUDI ARABIA', 'Saudi Arabia', 'SAU', 682, 966),
(188, 'SN', 'SENEGAL', 'Senegal', 'SEN', 686, 221),
(189, 'CS', 'SERBIA AND MONTENEGRO', 'Serbia and Montenegro', NULL, NULL, 381),
(190, 'SC', 'SEYCHELLES', 'Seychelles', 'SYC', 690, 248),
(191, 'SL', 'SIERRA LEONE', 'Sierra Leone', 'SLE', 694, 232),
(192, 'SG', 'SINGAPORE', 'Singapore', 'SGP', 702, 65),
(193, 'SK', 'SLOVAKIA', 'Slovakia', 'SVK', 703, 421),
(194, 'SI', 'SLOVENIA', 'Slovenia', 'SVN', 705, 386),
(195, 'SB', 'SOLOMON ISLANDS', 'Solomon Islands', 'SLB', 90, 677),
(196, 'SO', 'SOMALIA', 'Somalia', 'SOM', 706, 252),
(197, 'ZA', 'SOUTH AFRICA', 'South Africa', 'ZAF', 710, 27),
(198, 'GS', 'SOUTH GEORGIA AND THE SOUTH SANDWICH ISLANDS', 'South Georgia and the South Sandwich Islands', NULL, NULL, 0),
(199, 'ES', 'SPAIN', 'Spain', 'ESP', 724, 34),
(200, 'LK', 'SRI LANKA', 'Sri Lanka', 'LKA', 144, 94),
(201, 'SD', 'SUDAN', 'Sudan', 'SDN', 736, 249),
(202, 'SR', 'SURINAME', 'Suriname', 'SUR', 740, 597),
(203, 'SJ', 'SVALBARD AND JAN MAYEN', 'Svalbard and Jan Mayen', 'SJM', 744, 47),
(204, 'SZ', 'SWAZILAND', 'Swaziland', 'SWZ', 748, 268),
(205, 'SE', 'SWEDEN', 'Sweden', 'SWE', 752, 46),
(206, 'CH', 'SWITZERLAND', 'Switzerland', 'CHE', 756, 41),
(207, 'SY', 'SYRIAN ARAB REPUBLIC', 'Syrian Arab Republic', 'SYR', 760, 963),
(208, 'TW', 'TAIWAN, PROVINCE OF CHINA', 'Taiwan, Province of China', 'TWN', 158, 886),
(209, 'TJ', 'TAJIKISTAN', 'Tajikistan', 'TJK', 762, 992),
(210, 'TZ', 'TANZANIA, UNITED REPUBLIC OF', 'Tanzania, United Republic of', 'TZA', 834, 255),
(211, 'TH', 'THAILAND', 'Thailand', 'THA', 764, 66),
(212, 'TL', 'TIMOR-LESTE', 'Timor-Leste', NULL, NULL, 670),
(213, 'TG', 'TOGO', 'Togo', 'TGO', 768, 228),
(214, 'TK', 'TOKELAU', 'Tokelau', 'TKL', 772, 690),
(215, 'TO', 'TONGA', 'Tonga', 'TON', 776, 676),
(216, 'TT', 'TRINIDAD AND TOBAGO', 'Trinidad and Tobago', 'TTO', 780, 1868),
(217, 'TN', 'TUNISIA', 'Tunisia', 'TUN', 788, 216),
(218, 'TR', 'TURKEY', 'Turkey', 'TUR', 792, 90),
(219, 'TM', 'TURKMENISTAN', 'Turkmenistan', 'TKM', 795, 7370),
(220, 'TC', 'TURKS AND CAICOS ISLANDS', 'Turks and Caicos Islands', 'TCA', 796, 1649),
(221, 'TV', 'TUVALU', 'Tuvalu', 'TUV', 798, 688),
(222, 'UG', 'UGANDA', 'Uganda', 'UGA', 800, 256),
(223, 'UA', 'UKRAINE', 'Ukraine', 'UKR', 804, 380),
(224, 'AE', 'UNITED ARAB EMIRATES', 'United Arab Emirates', 'ARE', 784, 971),
(225, 'GB', 'UNITED KINGDOM', 'United Kingdom', 'GBR', 826, 44),
(226, 'US', 'UNITED STATES', 'United States', 'USA', 840, 1),
(227, 'UM', 'UNITED STATES MINOR OUTLYING ISLANDS', 'United States Minor Outlying Islands', NULL, NULL, 1),
(228, 'UY', 'URUGUAY', 'Uruguay', 'URY', 858, 598),
(229, 'UZ', 'UZBEKISTAN', 'Uzbekistan', 'UZB', 860, 998),
(230, 'VU', 'VANUATU', 'Vanuatu', 'VUT', 548, 678),
(231, 'VE', 'VENEZUELA', 'Venezuela', 'VEN', 862, 58),
(232, 'VN', 'VIET NAM', 'Viet Nam', 'VNM', 704, 84),
(233, 'VG', 'VIRGIN ISLANDS, BRITISH', 'Virgin Islands, British', 'VGB', 92, 1284),
(234, 'VI', 'VIRGIN ISLANDS, U.S.', 'Virgin Islands, U.s.', 'VIR', 850, 1340),
(235, 'WF', 'WALLIS AND FUTUNA', 'Wallis and Futuna', 'WLF', 876, 681),
(236, 'EH', 'WESTERN SAHARA', 'Western Sahara', 'ESH', 732, 212),
(237, 'YE', 'YEMEN', 'Yemen', 'YEM', 887, 967),
(238, 'ZM', 'ZAMBIA', 'Zambia', 'ZMB', 894, 260),
(239, 'ZW', 'ZIMBABWE', 'Zimbabwe', 'ZWE', 716, 263);
@andriiosmak

This comment has been minimized.

Copy link

@andriiosmak andriiosmak commented May 17, 2013

thnx

@mrhysdavies

This comment has been minimized.

Copy link

@mrhysdavies mrhysdavies commented Jul 7, 2013

Thanks.

@ndizzle

This comment has been minimized.

Copy link

@ndizzle ndizzle commented Jul 8, 2013

Thanks!

@nodens13

This comment has been minimized.

Copy link

@nodens13 nodens13 commented Jul 11, 2013

Thanks!

@allanlaal

This comment has been minimized.

Copy link

@allanlaal allanlaal commented Aug 10, 2013

always useful, thank you!

@phutureproof

This comment has been minimized.

Copy link

@phutureproof phutureproof commented Sep 23, 2013

Much obliged

@srishilpa

This comment has been minimized.

Copy link

@srishilpa srishilpa commented Oct 17, 2013

Thank You So much...Saved my time..

@UnderGreen

This comment has been minimized.

Copy link

@UnderGreen UnderGreen commented Nov 7, 2013

Row 50: phonecode -> 243
Row 189: CS deleted -> http://www.iso.org/iso/iso_3166-2_newsletter_i-8_en.pdf

@dele

This comment has been minimized.

Copy link

@dele dele commented Nov 15, 2013

Thanks. MIssing:

INSERT INTO country VALUES (240, 'RS', 'SERBIA', 'Serbia', 'SRB', 688, 381);
INSERT INTO country VALUES (241, 'AP', 'ASIA PACIFIC REGION', 'Asia / Pacific Region', '0', 0, 0);
INSERT INTO country VALUES (242, 'ME', 'MONTENEGRO', 'Montenegro', 'MNE', 499, 382);
INSERT INTO country VALUES (243, 'AX', 'ALAND ISLANDS', 'Aland Islands', 'ALA', 248, 358);
INSERT INTO country VALUES (244, 'BQ', 'BONAIRE, SINT EUSTATIUS AND SABA', 'Bonaire, Sint Eustatius and Saba', 'BES', 535, 599);
INSERT INTO country VALUES (245, 'CW', 'CURACAO', 'Curacao', 'CUW', 531, 599);
INSERT INTO country VALUES (246, 'GG', 'GUERNSEY', 'Guernsey', 'GGY', 831, 44);
INSERT INTO country VALUES (247, 'IM', 'ISLE OF MAN', 'Isle of Man', 'IMN', 833, 44);
INSERT INTO country VALUES (248, 'JE', 'JERSEY', 'Jersey', 'JEY', 832, 44);
INSERT INTO country VALUES (249, 'XK', 'KOSOVO', 'Kosovo', '---', 0, 381);
INSERT INTO country VALUES (250, 'BL', 'SAINT BARTHELEMY', 'Saint Barthelemy', 'BLM', 652, 590);
INSERT INTO country VALUES (251, 'MF', 'SAINT MARTIN', 'Saint Martin', 'MAF', 663, 590);
INSERT INTO country VALUES (252, 'SX', 'SINT MAARTEN', 'Sint Maarten', 'SXM', 534, 1);
INSERT INTO country VALUES (253, 'SS', 'SOUTH SUDAN', 'South Sudan', 'SSD', 728, 211);

@lillem4n

This comment has been minimized.

Copy link

@lillem4n lillem4n commented Nov 23, 2013

If you wish to distinguish between Canada and USA and other areas that shares country codes, I have a version here: https://github.com/hemligabyran/calling_codes

Someone with some time on their hands might end up merging these, since you have more and better territory information (iso3, names etc).

I needed this database to be sure to be able to fetch what country a specific number came from.

@elwanshow

This comment has been minimized.

Copy link

@elwanshow elwanshow commented Dec 20, 2013

Thank you make save my time :)

@missjojo

This comment has been minimized.

Copy link

@missjojo missjojo commented Jan 6, 2014

DO (Dominican Republic) has more than one International Direct Dialing code: 1809, 1829 and 1849. How to work with it? See: http://en.wikipedia.org/wiki/List_of_country_calling_codes

@amirolzolkifli

This comment has been minimized.

Copy link

@amirolzolkifli amirolzolkifli commented Jan 23, 2014

Thank you very much for this list!

@mjebrini

This comment has been minimized.

Copy link

@mjebrini mjebrini commented Mar 3, 2014

Great list thanks you!

@u007

This comment has been minimized.

Copy link

@u007 u007 commented Mar 22, 2014

thank you :)

@orrgal1

This comment has been minimized.

Copy link

@orrgal1 orrgal1 commented May 13, 2014

hey great! how about adding the locale for each?

@dhritimanh

This comment has been minimized.

Copy link

@dhritimanh dhritimanh commented Jun 20, 2014

Nice ! Thanks !

@gpatsiaouras

This comment has been minimized.

Copy link

@gpatsiaouras gpatsiaouras commented Jul 7, 2014

Thank you very much! Saved me a lot of time

@c-basso

This comment has been minimized.

Copy link

@c-basso c-basso commented Oct 16, 2014

thank you. but Russian Federation phonecode is 7, not 70

@AmarAneja

This comment has been minimized.

Copy link

@AmarAneja AmarAneja commented Nov 19, 2014

INSERT INTO country VALUES (NULL , 'RS', 'SERBIA', 'Serbia', 'SRB', '688', '381');
INSERT INTO country VALUES (241, 'AP', 'ASIA PACIFIC REGION', 'Asia / Pacific Region', '0','0','0');
INSERT INTO country VALUES (242, 'ME', 'MONTENEGRO', 'Montenegro', 'MNE','499', '382');
INSERT INTO country VALUES (243, 'AX', 'ALAND ISLANDS', 'Aland Islands', 'ALA', '248', '358');
INSERT INTO country VALUES (244, 'BQ', 'BONAIRE, SINT EUSTATIUS AND SABA', 'Bonaire, Sint Eustatius and Saba', 'BES', '535', '599');
INSERT INTO country VALUES (245, 'CW', 'CURACAO', 'Curacao', 'CUW', '531', '599');
INSERT INTO country VALUES (246, 'GG', 'GUERNSEY', 'Guernsey', 'GGY', '831', '44');
INSERT INTO country VALUES (247, 'IM', 'ISLE OF MAN', 'Isle of Man', 'IMN', '833', '44');
INSERT INTO country VALUES (248, 'JE', 'JERSEY', 'Jersey', 'JEY', '832', '44');
INSERT INTO country VALUES (249, 'XK', 'KOSOVO', 'Kosovo', '---', '0', '381');
INSERT INTO country VALUES (250, 'BL', 'SAINT BARTHELEMY', 'Saint Barthelemy', 'BLM', '652', '590');
INSERT INTO country VALUES (251, 'MF', 'SAINT MARTIN', 'Saint Martin', 'MAF', '663', '590');
INSERT INTO country VALUES (252, 'SX', 'SINT MAARTEN', 'Sint Maarten', 'SXM', '534', '1');
INSERT INTO country VALUES (253, 'SS', 'SOUTH SUDAN', 'South Sudan', 'SSD', '728', '211');

@lizhuomeng71

This comment has been minimized.

Copy link

@lizhuomeng71 lizhuomeng71 commented Mar 11, 2015

Great! Thanks a lot

@paulochf

This comment has been minimized.

Copy link

@paulochf paulochf commented Mar 30, 2015

I updated this list using the comments above.

https://gist.github.com/paulochf/9616f85f3f3904f1c36f

@Doopin

This comment has been minimized.

Copy link

@Doopin Doopin commented Apr 27, 2015

Thanks a lot!

@rootturk

This comment has been minimized.

Copy link

@rootturk rootturk commented May 26, 2015

thanks man!

@karthicjayaraman

This comment has been minimized.

Copy link

@karthicjayaraman karthicjayaraman commented Jun 15, 2015

Thanks a lot!

@ghost

This comment has been minimized.

Copy link

@ghost ghost commented Jun 21, 2015

Thanks for the great list. I adapted it for Microsoft-SQL-Server. I removed the "id"-column because
the iso-code for the country is unique and therefor ideal for the purpose of a primary key. So I chose
"iso" as a primary key.

https://gist.github.com/markuskofler/fac1f72fc62ad33335f8

@iarovyi

This comment has been minimized.

Copy link

@iarovyi iarovyi commented Aug 9, 2015

Thanks!

@diogo10

This comment has been minimized.

Copy link

@diogo10 diogo10 commented Aug 20, 2015

Thanks !!!! =D

@urkh

This comment has been minimized.

Copy link

@urkh urkh commented Sep 17, 2015

Thanks!

@erdaldalkiran

This comment has been minimized.

Copy link

@erdaldalkiran erdaldalkiran commented Oct 18, 2015

Thanks

@SaqibVaid

This comment has been minimized.

Copy link

@SaqibVaid SaqibVaid commented Oct 26, 2015

If you are looking for a SQL Server version of it you can find a complete sql script here:
http://www.infomazing.net/blog/database-country-table-with-sql-insert-statements

@notchriss

This comment has been minimized.

Copy link

@notchriss notchriss commented Nov 10, 2015

id does not seem necessary and double name column just for uppercase does not seem too useful either

@notchriss

This comment has been minimized.

Copy link

@notchriss notchriss commented Nov 10, 2015

Also it's Vatican City and not Holy see, Palestine and not Palestine Occupied Territory, Macedonia (or Republic of Macedonia) and not Former Yugoslavia Republic of Macedonia, Falkland Islands and not Malvinas despite what Argentina want it to call in English. There were more mistakes, and no consistency at all, you call some countries by their common name, others by full official name and yet others by some made up name like aforementioned Macedonia. Last but not least, Vatican's code is 379 and not 39. I didn't check every single code but I suspect there may be more mistakes like this.

@notchriss

This comment has been minimized.

Copy link

@notchriss notchriss commented Nov 13, 2015

Also Serbia and Montenegro are two different countries.

DO NOT USE THIS SQL it's full of mistakes

@92Sam

This comment has been minimized.

Copy link

@92Sam 92Sam commented Nov 17, 2015

Thanks Dude!

@gmt-it

This comment has been minimized.

Copy link

@gmt-it gmt-it commented Dec 4, 2015

Maybe some of you need this: SQL Database with ISO2 and Country names in DE, EN, RU, FR, ES and IT. If someone has all 249 Countrys in other languages please post. See here to download: osTicket/osTicket#2775

@shery9

This comment has been minimized.

Copy link

@shery9 shery9 commented Feb 22, 2016

Thank you 👍

@bafi

This comment has been minimized.

Copy link

@bafi bafi commented Feb 26, 2016

Thanks

@akhorifa

This comment has been minimized.

Copy link

@akhorifa akhorifa commented Mar 12, 2016

Thank you soo much ! Great work

@GAlduini

This comment has been minimized.

Copy link

@GAlduini GAlduini commented Mar 23, 2016

Thanks!!!

@web-developer-in-bangalore

This comment has been minimized.

Copy link

@web-developer-in-bangalore web-developer-in-bangalore commented Apr 28, 2016

Really Helpful..Thanks

@sk4092

This comment has been minimized.

Copy link

@sk4092 sk4092 commented Apr 29, 2016

Thanx

@meetwithchuks

This comment has been minimized.

Copy link

@meetwithchuks meetwithchuks commented May 12, 2016

Thanks alot. The piece is a time saver.

@aquitania99

This comment has been minimized.

Copy link

@aquitania99 aquitania99 commented May 20, 2016

You're a legend mate! Thanks a lot!

@nirajanpoudel

This comment has been minimized.

Copy link

@nirajanpoudel nirajanpoudel commented Jun 21, 2016

it helps me lot, thanks

@krishnan-rock-on

This comment has been minimized.

Copy link

@krishnan-rock-on krishnan-rock-on commented Jul 25, 2016

thanks

@fkamlesh

This comment has been minimized.

Copy link

@fkamlesh fkamlesh commented Aug 11, 2016

Thank you

@ywoume

This comment has been minimized.

Copy link

@ywoume ywoume commented Aug 17, 2016

ok

@reuben-joseph

This comment has been minimized.

Copy link

@reuben-joseph reuben-joseph commented Sep 4, 2016

thanks a lot man...helpful

@malkitsingh

This comment has been minimized.

Copy link

@malkitsingh malkitsingh commented Sep 23, 2016

thanks, this was helpful. (Y)

@Chintan7027

This comment has been minimized.

Copy link

@Chintan7027 Chintan7027 commented Oct 1, 2016

More detail information about countries are here: mysql-dump-every-country-state

@JuanLH

This comment has been minimized.

Copy link

@JuanLH JuanLH commented Nov 8, 2016

thanks friend

@Dovsen

This comment has been minimized.

Copy link

@Dovsen Dovsen commented Nov 16, 2016

Thanks

@kelomaniack

This comment has been minimized.

Copy link

@kelomaniack kelomaniack commented Nov 25, 2016

Thanks alot! That saved me alot of time.

@anish137i

This comment has been minimized.

Copy link

@anish137i anish137i commented Jan 26, 2017

Thank that saves my lots of time

@mayurdpatil

This comment has been minimized.

Copy link

@mayurdpatil mayurdpatil commented Jan 28, 2017

Thanks

@sitthykun

This comment has been minimized.

Copy link

@sitthykun sitthykun commented Mar 8, 2017

thank

@arcarruda

This comment has been minimized.

Copy link

@arcarruda arcarruda commented Apr 17, 2017

Thanks

@mlukac89

This comment has been minimized.

Copy link

@mlukac89 mlukac89 commented May 27, 2017

Thanks

@acegilz

This comment has been minimized.

Copy link

@acegilz acegilz commented May 31, 2017

thanks

@AdelaKaraman

This comment has been minimized.

Copy link

@AdelaKaraman AdelaKaraman commented Jun 12, 2017

Thanks!

Correction:
INSERT INTO country VALUES (249, 'XK', 'KOSOVO', 'Kosovo', 'XKX', 0, 383);

@R3muSGFX

This comment has been minimized.

Copy link

@R3muSGFX R3muSGFX commented Jul 6, 2017

Thank you for the list.

@CupCoffe

This comment has been minimized.

Copy link

@CupCoffe CupCoffe commented Jul 19, 2017

Great! Thanks)

@davichoso

This comment has been minimized.

Copy link

@davichoso davichoso commented Aug 24, 2017

thx very usefull

@farizdotid

This comment has been minimized.

Copy link

@farizdotid farizdotid commented Sep 7, 2017

Thanks dude!

@panjiprasetyo

This comment has been minimized.

Copy link

@panjiprasetyo panjiprasetyo commented Sep 29, 2017

many thanks.......

@jegborges

This comment has been minimized.

Copy link

@jegborges jegborges commented Nov 24, 2017

Thanks very much

@norbe

This comment has been minimized.

Copy link

@norbe norbe commented Dec 13, 2017

For Romania, it should be:
(176, 'RO', 'ROMANIA', 'Romania', 'ROU', 642, 40),

@gundupatil

This comment has been minimized.

Copy link

@gundupatil gundupatil commented Dec 29, 2017

what about states?

@ashishgorana

This comment has been minimized.

Copy link

@ashishgorana ashishgorana commented Jan 3, 2018

Thank You!, It very usefull.

@ghost

This comment has been minimized.

Copy link

@ghost ghost commented Jan 23, 2018

Thanks for compilling and sharing this list

@arastooms

This comment has been minimized.

Copy link

@arastooms arastooms commented Jan 25, 2018

thnx

@daedwards767

This comment has been minimized.

Copy link

@daedwards767 daedwards767 commented Jan 31, 2018

Thank you!

@manueldevjour

This comment has been minimized.

Copy link

@manueldevjour manueldevjour commented Feb 14, 2018

Thanks for saving my time! <3

@pRob3

This comment has been minimized.

Copy link

@pRob3 pRob3 commented Mar 16, 2018

Time saver!
Made a MSSQL version and added the commented suggestions.
https://gist.github.com/pRob3/3a3d6c2c961e492418e42b01db39e34a

@anoopsaini

This comment has been minimized.

Copy link

@anoopsaini anoopsaini commented Apr 2, 2018

thanks Adhip Gupta

@KalanaPerera

This comment has been minimized.

Copy link

@KalanaPerera KalanaPerera commented May 9, 2018

thanks dude ++

@EricMcWinNer

This comment has been minimized.

Copy link

@EricMcWinNer EricMcWinNer commented May 12, 2018

This was a complete life saver...Thanks a bunch

@Allhassane

This comment has been minimized.

Copy link

@Allhassane Allhassane commented May 15, 2018

Thanks

@ihangan

This comment has been minimized.

Copy link

@ihangan ihangan commented May 30, 2018

Thanks!

@mizterp

This comment has been minimized.

Copy link

@mizterp mizterp commented Jun 3, 2018

WARNING, this data is incomplete. Please use the following MySQL ISO Country table instead.

Reasons:

  1. Official source was used to update/improve country names & codes.
  2. I recommend using the iso2 code as Primary Key and order by name when/if needed.
  3. No need for "nicename". Use MySQL UCASE function, change case before you output or use CSS.
  4. As of MySQL 5.6 I see no need for using MyISAM for this particular type of data (read more)
  5. Just like Timezones, certain countries use multiple E.164 Country Calling Codes. I recommend using a second table with the codes (see: List of Country Calling Codes)
@ShinKhmer

This comment has been minimized.

Copy link

@ShinKhmer ShinKhmer commented Jun 13, 2018

Hello ! Thank you so much !

@pabloyokese

This comment has been minimized.

Copy link

@pabloyokese pabloyokese commented Aug 2, 2018

nice one ! thank you

@pintasku

This comment has been minimized.

Copy link

@pintasku pintasku commented Aug 8, 2018

Nice bro good job

@cezar62882

This comment has been minimized.

Copy link

@cezar62882 cezar62882 commented Aug 10, 2018

Thank you very much!

@karimhb

This comment has been minimized.

Copy link

@karimhb karimhb commented Aug 11, 2018

Turkmenistan phone code according to google is 993 not 7370

@gitcnd

This comment has been minimized.

Copy link

@gitcnd gitcnd commented Aug 24, 2018

This is not all that useful. It is missing all the rules about how and when to drop the local trunk digits (e.g. the leading 0 in the UK, or the leading 80 in Belarus, etc).
Here is a good list: https://www.howtocallabroad.com/codes.html

@prashantidealittechno

This comment has been minimized.

Copy link

@prashantidealittechno prashantidealittechno commented Aug 28, 2018

can you add flag and currency symbols and timezone if possible?

@engHusseinMansour

This comment has been minimized.

Copy link

@engHusseinMansour engHusseinMansour commented Sep 23, 2018

thank you !

@oluseunAra

This comment has been minimized.

Copy link

@oluseunAra oluseunAra commented Sep 24, 2018

Awesome, Thanks a lot!

@Darktroy

This comment has been minimized.

Copy link

@Darktroy Darktroy commented Oct 25, 2018

Great Effort thanks man

@rsicarelli

This comment has been minimized.

Copy link

@rsicarelli rsicarelli commented Nov 17, 2018

Thanks for sharing it!

@shzaur

This comment has been minimized.

Copy link

@shzaur shzaur commented Nov 18, 2018

(177, 'RU', 'RUSSIAN FEDERATION', 'Russian Federation', 'RUS', 643, 70) => (177, 'RU', 'RUSSIAN FEDERATION', 'Russian Federation', 'RUS', 643, 7)

@manueldevjour

This comment has been minimized.

Copy link

@manueldevjour manueldevjour commented Nov 22, 2018

can you add flag and currency symbols and timezone if possible?

It would be possible to make it in this gist. But it's better if you use an API for flags.

@manueldevjour

This comment has been minimized.

Copy link

@manueldevjour manueldevjour commented Nov 22, 2018

Looks like this gist its not getting updates, so I'll try to copy it and make a new one for update it constantly.

@RaphaelBlehoue

This comment has been minimized.

Copy link

@RaphaelBlehoue RaphaelBlehoue commented Nov 23, 2018

thanks

@mishik182

This comment has been minimized.

Copy link

@mishik182 mishik182 commented Dec 27, 2018

Thank you very much!

@altentof

This comment has been minimized.

Copy link

@altentof altentof commented Jan 7, 2019

nice

@madgenius90

This comment has been minimized.

Copy link

@madgenius90 madgenius90 commented Feb 26, 2019

Thanks

@richakbee

This comment has been minimized.

Copy link

@richakbee richakbee commented Mar 18, 2019

THANKs

@rishi554

This comment has been minimized.

Copy link

@rishi554 rishi554 commented May 3, 2019

Can you add mobile number length into row.
For example:
CREATE TABLE IF NOT EXISTS country (
id int(11) NOT NULL AUTO_INCREMENT,
iso char(2) NOT NULL,
name varchar(80) NOT NULL,
nicename varchar(80) NOT NULL,
iso3 char(3) DEFAULT NULL,
numcode smallint(6) DEFAULT NULL,
phonecode int(5) NOT NULL,
phonelength int(15) NOT NULL,
PRIMARY KEY (id)
) ENGINE=MyISAM DEFAULT CHARSET=latin1;

For india:

INSERT INTO country (id, iso, name, nicename, iso3, numcode, phonecode,phonelength) VALUES(99, 'IN', 'INDIA', 'India', 'IND', 356, 91,10)

@onurkayaio

This comment has been minimized.

Copy link

@onurkayaio onurkayaio commented Jun 28, 2019

Thanks!

@michalstanko

This comment has been minimized.

Copy link

@michalstanko michalstanko commented Jun 28, 2019

FYI, the Czech Republic has recently adopted a new official short name: CZECHIA.

https://en.wikipedia.org/wiki/Name_of_the_Czech_Republic#Adoption_of_Czechia

@portasandrei

This comment has been minimized.

Copy link

@portasandrei portasandrei commented Aug 30, 2019

Big Thanks!!!

@jbogdanov

This comment has been minimized.

Copy link

@jbogdanov jbogdanov commented Apr 3, 2020

BE CAREFUL TO USE THIS! DATA IS VERY LEGACY!!!

Data is 8 years old! In telecom world things changing very often. If you want more relevant data, then use libphonenumber from Google.
They are releasing every 2 weeks number ranges updates!
https://github.com/google/libphonenumber/blob/master/release_notes.txt

@jbogdanov

This comment has been minimized.

Copy link

@jbogdanov jbogdanov commented Apr 3, 2020

This code will always generate you similar SQL that would be up-to-date

import com.google.i18n.phonenumbers.PhoneNumberUtil;

import java.util.Locale;
import java.util.Map;
import java.util.Set;
import java.util.TreeMap;

public class Country {

public static class CountryCode {

    private String isoCode;
    private String iso3Code;
    private String phoneCode;
    private String name;

    public CountryCode(String isoCode, String iso3Code, String phoneCode, String name) {
        this.isoCode = isoCode;
        this.iso3Code = iso3Code;
        this.phoneCode = phoneCode;
        this.name = name;
    }

    public String getIsoCode() {
        return isoCode;
    }

    public String getIso3Code() {
        return iso3Code;
    }

    public String getPhoneCode() {
        return phoneCode;
    }

    public String getName() {
        return name;
    }
}

private static final Map<String, CountryCode> COUNTRIES;

static {
    COUNTRIES = new TreeMap<>(String.CASE_INSENSITIVE_ORDER);

    Set<String> supportedRegions = PhoneNumberUtil.getInstance().getSupportedRegions();
    for (String isoCode : supportedRegions) {
        Locale locale = new Locale("", isoCode);
        String countryName = locale.getDisplayCountry(Locale.ENGLISH);
        String iso3Code = getIso3Country(locale);
        int callingCode = getCountryCallingCodeForIsoCode(isoCode);
        COUNTRIES.put(isoCode, new CountryCode(isoCode, iso3Code, String.valueOf(callingCode), countryName));
    }

    addAdditionalCountry("AC", "ACS", "Ascension Island");
    addAdditionalCountry("TA", "", "Tristan da Cunha");
    addAdditionalCountry("XK", "KOS", "Kosovo");
}

private static String getIso3Country(Locale locale) {
    try {
        return locale.getISO3Country();
    } catch (Exception e) {
        return "";
    }
}

private static void addAdditionalCountry(String isoCode, String iso3Code, String countryName) {
    int callingCode = getCountryCallingCodeForIsoCode(isoCode);
    if (callingCode != 0) {
        COUNTRIES.put(isoCode, new CountryCode(isoCode, iso3Code, String.valueOf(callingCode), countryName));
    }
}

public static int getCountryCallingCodeForIsoCode(String countryIsoCode) {
    return PhoneNumberUtil.getInstance().getCountryCodeForRegion(countryIsoCode);
}

public static void main(String[] args) {
    System.out.println("CREATE TABLE IF NOT EXISTS COUNTRY_ISO (\n" +
            "  COUNTRY_ISO char(2) NOT NULL,\n" +
            "  COUNTRY_ISO3 char(3) DEFAULT NULL,\n" +
            "  CALLING_CODE int(5) NOT NULL,\n" +
            "  NAME varchar(80) NOT NULL,\n" +
            "  PRIMARY KEY (COUNTRY_ISO)\n" +
            ") ENGINE=InnoDB;");

    System.out.println("INSERT IGNORE INTO COUNTRY_ISO (`COUNTRY_ISO`, `COUNTRY_ISO3`, `CALLING_CODE`, `NAME`)\nVALUES");
    for (Map.Entry<String, CountryCode> entry : COUNTRIES.entrySet()) {
        CountryCode countryCode = entry.getValue();
        final String countryIsoCode = entry.getKey();

        System.out.println(String.format("(\"%s\", \"%s\", \"%s\", \"%s\"),", countryIsoCode, countryCode.getIso3Code(), countryCode.getPhoneCode(), countryCode.getName()));
    }
}

}

@jbogdanov

This comment has been minimized.

Copy link

@jbogdanov jbogdanov commented Apr 3, 2020

`
CREATE TABLE IF NOT EXISTS COUNTRY_ISO (
COUNTRY_ISO char(2) NOT NULL,
COUNTRY_ISO3 char(3) DEFAULT NULL,
CALLING_CODE int(5) NOT NULL,
NAME varchar(80) NOT NULL,
PRIMARY KEY (COUNTRY_ISO)
) ENGINE=InnoDB;

INSERT IGNORE INTO COUNTRY_ISO (COUNTRY_ISO, COUNTRY_ISO3, CALLING_CODE, NAME)
VALUES
("AC", "ACS", "247", "Ascension Island"),
("AD", "AND", "376", "Andorra"),
("AE", "ARE", "971", "United Arab Emirates"),
("AF", "AFG", "93", "Afghanistan"),
("AG", "ATG", "1", "Antigua and Barbuda"),
("AI", "AIA", "1", "Anguilla"),
("AL", "ALB", "355", "Albania"),
("AM", "ARM", "374", "Armenia"),
("AO", "AGO", "244", "Angola"),
("AR", "ARG", "54", "Argentina"),
("AS", "ASM", "1", "American Samoa"),
("AT", "AUT", "43", "Austria"),
("AU", "AUS", "61", "Australia"),
("AW", "ABW", "297", "Aruba"),
("AX", "ALA", "358", "Åland Islands"),
("AZ", "AZE", "994", "Azerbaijan"),
("BA", "BIH", "387", "Bosnia and Herzegovina"),
("BB", "BRB", "1", "Barbados"),
("BD", "BGD", "880", "Bangladesh"),
("BE", "BEL", "32", "Belgium"),
("BF", "BFA", "226", "Burkina Faso"),
("BG", "BGR", "359", "Bulgaria"),
("BH", "BHR", "973", "Bahrain"),
("BI", "BDI", "257", "Burundi"),
("BJ", "BEN", "229", "Benin"),
("BL", "BLM", "590", "Saint Barthélemy"),
("BM", "BMU", "1", "Bermuda"),
("BN", "BRN", "673", "Brunei"),
("BO", "BOL", "591", "Bolivia"),
("BQ", "BES", "599", "Bonaire, Sint Eustatius and Saba"),
("BR", "BRA", "55", "Brazil"),
("BS", "BHS", "1", "Bahamas"),
("BT", "BTN", "975", "Bhutan"),
("BW", "BWA", "267", "Botswana"),
("BY", "BLR", "375", "Belarus"),
("BZ", "BLZ", "501", "Belize"),
("CA", "CAN", "1", "Canada"),
("CC", "CCK", "61", "Cocos Islands"),
("CD", "COD", "243", "The Democratic Republic Of Congo"),
("CF", "CAF", "236", "Central African Republic"),
("CG", "COG", "242", "Congo"),
("CH", "CHE", "41", "Switzerland"),
("CI", "CIV", "225", "Côte d'Ivoire"),
("CK", "COK", "682", "Cook Islands"),
("CL", "CHL", "56", "Chile"),
("CM", "CMR", "237", "Cameroon"),
("CN", "CHN", "86", "China"),
("CO", "COL", "57", "Colombia"),
("CR", "CRI", "506", "Costa Rica"),
("CU", "CUB", "53", "Cuba"),
("CV", "CPV", "238", "Cape Verde"),
("CW", "CUW", "599", "Curaçao"),
("CX", "CXR", "61", "Christmas Island"),
("CY", "CYP", "357", "Cyprus"),
("CZ", "CZE", "420", "Czech Republic"),
("DE", "DEU", "49", "Germany"),
("DJ", "DJI", "253", "Djibouti"),
("DK", "DNK", "45", "Denmark"),
("DM", "DMA", "1", "Dominica"),
("DO", "DOM", "1", "Dominican Republic"),
("DZ", "DZA", "213", "Algeria"),
("EC", "ECU", "593", "Ecuador"),
("EE", "EST", "372", "Estonia"),
("EG", "EGY", "20", "Egypt"),
("EH", "ESH", "212", "Western Sahara"),
("ER", "ERI", "291", "Eritrea"),
("ES", "ESP", "34", "Spain"),
("ET", "ETH", "251", "Ethiopia"),
("FI", "FIN", "358", "Finland"),
("FJ", "FJI", "679", "Fiji"),
("FK", "FLK", "500", "Falkland Islands"),
("FM", "FSM", "691", "Micronesia"),
("FO", "FRO", "298", "Faroe Islands"),
("FR", "FRA", "33", "France"),
("GA", "GAB", "241", "Gabon"),
("GB", "GBR", "44", "United Kingdom"),
("GD", "GRD", "1", "Grenada"),
("GE", "GEO", "995", "Georgia"),
("GF", "GUF", "594", "French Guiana"),
("GG", "GGY", "44", "Guernsey"),
("GH", "GHA", "233", "Ghana"),
("GI", "GIB", "350", "Gibraltar"),
("GL", "GRL", "299", "Greenland"),
("GM", "GMB", "220", "Gambia"),
("GN", "GIN", "224", "Guinea"),
("GP", "GLP", "590", "Guadeloupe"),
("GQ", "GNQ", "240", "Equatorial Guinea"),
("GR", "GRC", "30", "Greece"),
("GT", "GTM", "502", "Guatemala"),
("GU", "GUM", "1", "Guam"),
("GW", "GNB", "245", "Guinea-Bissau"),
("GY", "GUY", "592", "Guyana"),
("HK", "HKG", "852", "Hong Kong"),
("HN", "HND", "504", "Honduras"),
("HR", "HRV", "385", "Croatia"),
("HT", "HTI", "509", "Haiti"),
("HU", "HUN", "36", "Hungary"),
("ID", "IDN", "62", "Indonesia"),
("IE", "IRL", "353", "Ireland"),
("IL", "ISR", "972", "Israel"),
("IM", "IMN", "44", "Isle Of Man"),
("IN", "IND", "91", "India"),
("IO", "IOT", "246", "British Indian Ocean Territory"),
("IQ", "IRQ", "964", "Iraq"),
("IR", "IRN", "98", "Iran"),
("IS", "ISL", "354", "Iceland"),
("IT", "ITA", "39", "Italy"),
("JE", "JEY", "44", "Jersey"),
("JM", "JAM", "1", "Jamaica"),
("JO", "JOR", "962", "Jordan"),
("JP", "JPN", "81", "Japan"),
("KE", "KEN", "254", "Kenya"),
("KG", "KGZ", "996", "Kyrgyzstan"),
("KH", "KHM", "855", "Cambodia"),
("KI", "KIR", "686", "Kiribati"),
("KM", "COM", "269", "Comoros"),
("KN", "KNA", "1", "Saint Kitts And Nevis"),
("KP", "PRK", "850", "North Korea"),
("KR", "KOR", "82", "South Korea"),
("KW", "KWT", "965", "Kuwait"),
("KY", "CYM", "1", "Cayman Islands"),
("KZ", "KAZ", "7", "Kazakhstan"),
("LA", "LAO", "856", "Laos"),
("LB", "LBN", "961", "Lebanon"),
("LC", "LCA", "1", "Saint Lucia"),
("LI", "LIE", "423", "Liechtenstein"),
("LK", "LKA", "94", "Sri Lanka"),
("LR", "LBR", "231", "Liberia"),
("LS", "LSO", "266", "Lesotho"),
("LT", "LTU", "370", "Lithuania"),
("LU", "LUX", "352", "Luxembourg"),
("LV", "LVA", "371", "Latvia"),
("LY", "LBY", "218", "Libya"),
("MA", "MAR", "212", "Morocco"),
("MC", "MCO", "377", "Monaco"),
("MD", "MDA", "373", "Moldova"),
("ME", "MNE", "382", "Montenegro"),
("MF", "MAF", "590", "Saint Martin"),
("MG", "MDG", "261", "Madagascar"),
("MH", "MHL", "692", "Marshall Islands"),
("MK", "MKD", "389", "Macedonia"),
("ML", "MLI", "223", "Mali"),
("MM", "MMR", "95", "Myanmar"),
("MN", "MNG", "976", "Mongolia"),
("MO", "MAC", "853", "Macao"),
("MP", "MNP", "1", "Northern Mariana Islands"),
("MQ", "MTQ", "596", "Martinique"),
("MR", "MRT", "222", "Mauritania"),
("MS", "MSR", "1", "Montserrat"),
("MT", "MLT", "356", "Malta"),
("MU", "MUS", "230", "Mauritius"),
("MV", "MDV", "960", "Maldives"),
("MW", "MWI", "265", "Malawi"),
("MX", "MEX", "52", "Mexico"),
("MY", "MYS", "60", "Malaysia"),
("MZ", "MOZ", "258", "Mozambique"),
("NA", "NAM", "264", "Namibia"),
("NC", "NCL", "687", "New Caledonia"),
("NE", "NER", "227", "Niger"),
("NF", "NFK", "672", "Norfolk Island"),
("NG", "NGA", "234", "Nigeria"),
("NI", "NIC", "505", "Nicaragua"),
("NL", "NLD", "31", "Netherlands"),
("NO", "NOR", "47", "Norway"),
("NP", "NPL", "977", "Nepal"),
("NR", "NRU", "674", "Nauru"),
("NU", "NIU", "683", "Niue"),
("NZ", "NZL", "64", "New Zealand"),
("OM", "OMN", "968", "Oman"),
("PA", "PAN", "507", "Panama"),
("PE", "PER", "51", "Peru"),
("PF", "PYF", "689", "French Polynesia"),
("PG", "PNG", "675", "Papua New Guinea"),
("PH", "PHL", "63", "Philippines"),
("PK", "PAK", "92", "Pakistan"),
("PL", "POL", "48", "Poland"),
("PM", "SPM", "508", "Saint Pierre And Miquelon"),
("PR", "PRI", "1", "Puerto Rico"),
("PS", "PSE", "970", "Palestine"),
("PT", "PRT", "351", "Portugal"),
("PW", "PLW", "680", "Palau"),
("PY", "PRY", "595", "Paraguay"),
("QA", "QAT", "974", "Qatar"),
("RE", "REU", "262", "Reunion"),
("RO", "ROU", "40", "Romania"),
("RS", "SRB", "381", "Serbia"),
("RU", "RUS", "7", "Russia"),
("RW", "RWA", "250", "Rwanda"),
("SA", "SAU", "966", "Saudi Arabia"),
("SB", "SLB", "677", "Solomon Islands"),
("SC", "SYC", "248", "Seychelles"),
("SD", "SDN", "249", "Sudan"),
("SE", "SWE", "46", "Sweden"),
("SG", "SGP", "65", "Singapore"),
("SH", "SHN", "290", "Saint Helena"),
("SI", "SVN", "386", "Slovenia"),
("SJ", "SJM", "47", "Svalbard And Jan Mayen"),
("SK", "SVK", "421", "Slovakia"),
("SL", "SLE", "232", "Sierra Leone"),
("SM", "SMR", "378", "San Marino"),
("SN", "SEN", "221", "Senegal"),
("SO", "SOM", "252", "Somalia"),
("SR", "SUR", "597", "Suriname"),
("SS", "SSD", "211", "South Sudan"),
("ST", "STP", "239", "Sao Tome And Principe"),
("SV", "SLV", "503", "El Salvador"),
("SX", "SXM", "1", "Sint Maarten (Dutch part)"),
("SY", "SYR", "963", "Syria"),
("SZ", "SWZ", "268", "Swaziland"),
("TA", "", "290", "Tristan da Cunha"),
("TC", "TCA", "1", "Turks And Caicos Islands"),
("TD", "TCD", "235", "Chad"),
("TG", "TGO", "228", "Togo"),
("TH", "THA", "66", "Thailand"),
("TJ", "TJK", "992", "Tajikistan"),
("TK", "TKL", "690", "Tokelau"),
("TL", "TLS", "670", "Timor-Leste"),
("TM", "TKM", "993", "Turkmenistan"),
("TN", "TUN", "216", "Tunisia"),
("TO", "TON", "676", "Tonga"),
("TR", "TUR", "90", "Turkey"),
("TT", "TTO", "1", "Trinidad and Tobago"),
("TV", "TUV", "688", "Tuvalu"),
("TW", "TWN", "886", "Taiwan"),
("TZ", "TZA", "255", "Tanzania"),
("UA", "UKR", "380", "Ukraine"),
("UG", "UGA", "256", "Uganda"),
("US", "USA", "1", "United States"),
("UY", "URY", "598", "Uruguay"),
("UZ", "UZB", "998", "Uzbekistan"),
("VA", "VAT", "39", "Vatican"),
("VC", "VCT", "1", "Saint Vincent And The Grenadines"),
("VE", "VEN", "58", "Venezuela"),
("VG", "VGB", "1", "British Virgin Islands"),
("VI", "VIR", "1", "U.S. Virgin Islands"),
("VN", "VNM", "84", "Vietnam"),
("VU", "VUT", "678", "Vanuatu"),
("WF", "WLF", "681", "Wallis And Futuna"),
("WS", "WSM", "685", "Samoa"),
("XK", "KOS", "383", "Kosovo"),
("YE", "YEM", "967", "Yemen"),
("YT", "MYT", "262", "Mayotte"),
("ZA", "ZAF", "27", "South Africa"),
("ZM", "ZMB", "260", "Zambia"),
("ZW", "ZWE", "263", "Zimbabwe");`

@nawissor

This comment has been minimized.

Copy link

@nawissor nawissor commented Apr 13, 2020

Super awesome! Thanks!!

@1amitgupta

This comment has been minimized.

Copy link

@1amitgupta 1amitgupta commented Aug 13, 2020

Thanks buddy. 👍

@maotora

This comment has been minimized.

Copy link

@maotora maotora commented Aug 21, 2020

🔥🔥🔥 One of the most useful gists on the web!

Thanks!

@anayetsohag

This comment has been minimized.

Copy link

@anayetsohag anayetsohag commented Aug 24, 2020

Thank you...

@thebaud2u

This comment has been minimized.

Copy link

@thebaud2u thebaud2u commented Aug 27, 2020

Thanks a lot.

@TeamInsideSoftwares

This comment has been minimized.

Copy link

@TeamInsideSoftwares TeamInsideSoftwares commented Sep 1, 2020

Thanks a lot. It was really helpful to get the country list through this post.

@aristosamar

This comment has been minimized.

Copy link

@aristosamar aristosamar commented Oct 9, 2020

muchas gracias

@InspiredPrynce

This comment has been minimized.

Copy link

@InspiredPrynce InspiredPrynce commented Oct 26, 2020

Thank you so much 👍
muchas gracias

@HaydeSoft

This comment has been minimized.

Copy link

@HaydeSoft HaydeSoft commented Nov 22, 2020

thanks

@asyam1

This comment has been minimized.

Copy link

@asyam1 asyam1 commented Dec 2, 2020

Thanks a lot 👍

@sieta1

This comment has been minimized.

Copy link

@sieta1 sieta1 commented Dec 17, 2020

Thanks.. 👍 👍 👍

@BenjamimRodrigo

This comment has been minimized.

Copy link

@BenjamimRodrigo BenjamimRodrigo commented Dec 20, 2020

😃 Obrigado / Thanks!

@sunilvijayan7

This comment has been minimized.

Copy link

@sunilvijayan7 sunilvijayan7 commented Jan 27, 2021

Thanks. This is really usefull :)

@ajmedway

This comment has been minimized.

Copy link

@ajmedway ajmedway commented Feb 3, 2021

@josephakande-sb

This comment has been minimized.

Copy link

@josephakande-sb josephakande-sb commented Mar 23, 2021

This is super helpful. Thank you!!!!!!!!!

@Expertweblancer

This comment has been minimized.

Copy link

@Expertweblancer Expertweblancer commented Apr 12, 2021

Thank you

@mathieu-duverne

This comment has been minimized.

Copy link

@mathieu-duverne mathieu-duverne commented Apr 22, 2021

<3

@mokhtarHamdoune

This comment has been minimized.

Copy link

@mokhtarHamdoune mokhtarHamdoune commented Jun 19, 2021

thank you ^_~

@umar-xd

This comment has been minimized.

Copy link

@umar-xd umar-xd commented Jun 23, 2021

thanks you saved a lot of time

@Messhias

This comment has been minimized.

Copy link

@Messhias Messhias commented Jul 2, 2021

In the list is missing Scotland, Wales and Nothern Ireland, the United Kingdom EVEN in the ISO standards the people and region on there DOESN'T recognized usually they're living in the UK, it's more correct update the list and add this countries.

@EmeraldSunday

This comment has been minimized.

Copy link

@EmeraldSunday EmeraldSunday commented Jul 24, 2021

Thanks a lot

@BenoitAdam94

This comment has been minimized.

Copy link

@BenoitAdam94 BenoitAdam94 commented Sep 2, 2021

who has the best fork ?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment