SQL Tips – List of Countries (2018 revision)

Over nine years ago, I published a SQL and tab delimited list of countries sourced from Wikipedia and ISO. After numerous comments about it being out of date, here is an updated version…..

The data was sourced from Wikipedia and ISO.

This data is correct as of 29 April 2018.

Note that some countries have single quotes in their names, these need to be escaped for SQL. The SQL below is escaped, but the tab delimited version is not.

Please post a comment if you find this useful.


SQL Version:

INSERT INTO countryTable (numeric, alpha3, alpha2, name)
VALUES
('4','AFG','AF','Afghanistan'),
('248','ALA','AX','Åland Islands'),
('8','ALB','AL','Albania'),
('12','DZA','DZ','Algeria'),
('16','ASM','AS','American Samoa'),
('20','AND','AD','Andorra'),
('24','AGO','AO','Angola'),
('660','AIA','AI','Anguilla'),
('10','ATA','AQ','Antarctica'),
('28','ATG','AG','Antigua and Barbuda'),
('32','ARG','AR','Argentina'),
('51','ARM','AM','Armenia'),
('533','ABW','AW','Aruba'),
('36','AUS','AU','Australia'),
('40','AUT','AT','Austria'),
('31','AZE','AZ','Azerbaijan'),
('44','BHS','BS','Bahamas'),
('48','BHR','BH','Bahrain'),
('50','BGD','BD','Bangladesh'),
('52','BRB','BB','Barbados'),
('112','BLR','BY','Belarus'),
('56','BEL','BE','Belgium'),
('84','BLZ','BZ','Belize'),
('204','BEN','BJ','Benin'),
('60','BMU','BM','Bermuda'),
('64','BTN','BT','Bhutan'),
('68','BOL','BO','Bolivia (Plurinational State of)'),
('535','BES','BQ','Bonaire, Sint Eustatius and Saba'),
('70','BIH','BA','Bosnia and Herzegovina'),
('72','BWA','BW','Botswana'),
('74','BVT','BV','Bouvet Island'),
('76','BRA','BR','Brazil'),
('86','IOT','IO','British Indian Ocean Territory'),
('96','BRN','BN','Brunei Darussalam'),
('100','BGR','BG','Bulgaria'),
('854','BFA','BF','Burkina Faso'),
('108','BDI','BI','Burundi'),
('132','CPV','CV','Cabo Verde'),
('116','KHM','KH','Cambodia'),
('120','CMR','CM','Cameroon'),
('124','CAN','CA','Canada'),
('136','CYM','KY','Cayman Islands'),
('140','CAF','CF','Central African Republic'),
('148','TCD','TD','Chad'),
('152','CHL','CL','Chile'),
('156','CHN','CN','China'),
('162','CXR','CX','Christmas Island'),
('166','CCK','CC','Cocos (Keeling) Islands'),
('170','COL','CO','Colombia'),
('174','COM','KM','Comoros'),
('178','COG','CG','Congo'),
('180','COD','CD','Congo (Democratic Republic of the)'),
('184','COK','CK','Cook Islands'),
('188','CRI','CR','Costa Rica'),
('384','CIV','CI','Côte d''Ivoire'),
('191','HRV','HR','Croatia'),
('192','CUB','CU','Cuba'),
('531','CUW','CW','Curaçao'),
('196','CYP','CY','Cyprus'),
('203','CZE','CZ','Czechia'),
('208','DNK','DK','Denmark'),
('262','DJI','DJ','Djibouti'),
('212','DMA','DM','Dominica'),
('214','DOM','DO','Dominican Republic'),
('218','ECU','EC','Ecuador'),
('818','EGY','EG','Egypt'),
('222','SLV','SV','El Salvador'),
('226','GNQ','GQ','Equatorial Guinea'),
('232','ERI','ER','Eritrea'),
('233','EST','EE','Estonia'),
('231','ETH','ET','Ethiopia'),
('238','FLK','FK','Falkland Islands (Malvinas)'),
('234','FRO','FO','Faroe Islands'),
('242','FJI','FJ','Fiji'),
('246','FIN','FI','Finland'),
('250','FRA','FR','France'),
('254','GUF','GF','French Guiana'),
('258','PYF','PF','French Polynesia'),
('260','ATF','TF','French Southern Territories'),
('266','GAB','GA','Gabon'),
('270','GMB','GM','Gambia'),
('268','GEO','GE','Georgia'),
('276','DEU','DE','Germany'),
('288','GHA','GH','Ghana'),
('292','GIB','GI','Gibraltar'),
('300','GRC','GR','Greece'),
('304','GRL','GL','Greenland'),
('308','GRD','GD','Grenada'),
('312','GLP','GP','Guadeloupe'),
('316','GUM','GU','Guam'),
('320','GTM','GT','Guatemala'),
('831','GGY','GG','Guernsey'),
('324','GIN','GN','Guinea'),
('624','GNB','GW','Guinea-Bissau'),
('328','GUY','GY','Guyana'),
('332','HTI','HT','Haiti'),
('334','HMD','HM','Heard Island and McDonald Islands'),
('336','VAT','VA','Holy See (Vatican City State)'),
('340','HND','HN','Honduras'),
('344','HKG','HK','Hong Kong'),
('348','HUN','HU','Hungary'),
('352','ISL','IS','Iceland'),
('356','IND','IN','India'),
('360','IDN','ID','Indonesia'),
('364','IRN','IR','Iran (Islamic Republic of)'),
('368','IRQ','IQ','Iraq'),
('372','IRL','IE','Ireland'),
('833','IMN','IM','Isle of Man'),
('376','ISR','IL','Israel'),
('380','ITA','IT','Italy'),
('388','JAM','JM','Jamaica'),
('392','JPN','JP','Japan'),
('832','JEY','JE','Jersey'),
('400','JOR','JO','Jordan'),
('398','KAZ','KZ','Kazakhstan'),
('404','KEN','KE','Kenya'),
('296','KIR','KI','Kiribati'),
('408','PRK','KP','Korea, Democratic People''s Republic of'),
('410','KOR','KR','Korea, Republic of'),
('414','KWT','KW','Kuwait'),
('417','KGZ','KG','Kyrgyzstan'),
('418','LAO','LA','Lao People''s Democratic Republic'),
('428','LVA','LV','Latvia'),
('422','LBN','LB','Lebanon'),
('426','LSO','LS','Lesotho'),
('430','LBR','LR','Liberia'),
('434','LBY','LY','Libya'),
('438','LIE','LI','Liechtenstein'),
('440','LTU','LT','Lithuania'),
('442','LUX','LU','Luxembourg'),
('446','MAC','MO','Macao'),
('807','MKD','MK','Macedonia (the former Yugoslav Republic of)'),
('450','MDG','MG','Madagascar'),
('454','MWI','MW','Malawi'),
('458','MYS','MY','Malaysia'),
('462','MDV','MV','Maldives'),
('466','MLI','ML','Mali'),
('470','MLT','MT','Malta'),
('584','MHL','MH','Marshall Islands'),
('474','MTQ','MQ','Martinique'),
('478','MRT','MR','Mauritania'),
('480','MUS','MU','Mauritius'),
('175','MYT','YT','Mayotte'),
('484','MEX','MX','Mexico'),
('583','FSM','FM','Micronesia, Federated States of'),
('498','MDA','MD','Moldova, Republic of'),
('492','MCO','MC','Monaco'),
('496','MNG','MN','Mongolia'),
('499','MNE','ME','Montenegro'),
('500','MSR','MS','Montserrat'),
('504','MAR','MA','Morocco'),
('508','MOZ','MZ','Mozambique'),
('104','MMR','MM','Myanmar'),
('516','NAM','NA','Namibia'),
('520','NRU','NR','Nauru'),
('524','NPL','NP','Nepal'),
('528','NLD','NL','Netherlands'),
('540','NCL','NC','New Caledonia'),
('554','NZL','NZ','New Zealand'),
('558','NIC','NI','Nicaragua'),
('562','NER','NE','Niger'),
('566','NGA','NG','Nigeria'),
('570','NIU','NU','Niue'),
('574','NFK','NF','Norfolk Island'),
('580','MNP','MP','Northern Mariana Islands'),
('578','NOR','NO','Norway'),
('512','OMN','OM','Oman'),
('586','PAK','PK','Pakistan'),
('585','PLW','PW','Palau'),
('275','PSE','PS','Palestine, State of'),
('591','PAN','PA','Panama'),
('598','PNG','PG','Papua New Guinea'),
('600','PRY','PY','Paraguay'),
('604','PER','PE','Peru'),
('608','PHL','PH','Philippines'),
('612','PCN','PN','Pitcairn'),
('616','POL','PL','Poland'),
('620','PRT','PT','Portugal'),
('630','PRI','PR','Puerto Rico'),
('634','QAT','QA','Qatar'),
('638','REU','RE','Réunion'),
('642','ROU','RO','Romania'),
('643','RUS','RU','Russian Federation'),
('646','RWA','RW','Rwanda'),
('652','BLM','BL','Saint Barthélemy'),
('654','SHN','SH','Saint Helena, Ascension and Tristan da Cunha'),
('659','KNA','KN','Saint Kitts and Nevis'),
('662','LCA','LC','Saint Lucia'),
('663','MAF','MF','Saint Martin (French part)'),
('666','SPM','PM','Saint Pierre and Miquelon'),
('670','VCT','VC','Saint Vincent and the Grenadines'),
('882','WSM','WS','Samoa'),
('674','SMR','SM','San Marino'),
('678','STP','ST','Sao Tome and Principe'),
('682','SAU','SA','Saudi Arabia'),
('686','SEN','SN','Senegal'),
('688','SRB','RS','Serbia'),
('690','SYC','SC','Seychelles'),
('694','SLE','SL','Sierra Leone'),
('702','SGP','SG','Singapore'),
('534','SXM','SX','Sint Maarten (Dutch part)'),
('703','SVK','SK','Slovakia'),
('705','SVN','SI','Slovenia'),
('90','SLB','SB','Solomon Islands'),
('706','SOM','SO','Somalia'),
('710','ZAF','ZA','South Africa'),
('239','SGS','GS','South Georgia and the South Sandwich Islands'),
('728','SSD','SS','South Sudan'),
('724','ESP','ES','Spain'),
('144','LKA','LK','Sri Lanka'),
('729','SDN','SD','Sudan'),
('740','SUR','SR','Suriname'),
('744','SJM','SJ','Svalbard and Jan Mayen'),
('748','SWZ','SZ','Swaziland'),
('752','SWE','SE','Sweden'),
('756','CHE','CH','Switzerland'),
('760','SYR','SY','Syrian Arab Republic'),
('158','TWN','TW','Taiwan, Province of China'),
('762','TJK','TJ','Tajikistan'),
('834','TZA','TZ','Tanzania, United Republic of'),
('764','THA','TH','Thailand'),
('626','TLS','TL','Timor-Leste'),
('768','TGO','TG','Togo'),
('772','TKL','TK','Tokelau'),
('776','TON','TO','Tonga'),
('780','TTO','TT','Trinidad and Tobago'),
('788','TUN','TN','Tunisia'),
('792','TUR','TR','Turkey'),
('795','TKM','TM','Turkmenistan'),
('796','TCA','TC','Turks and Caicos Islands'),
('798','TUV','TV','Tuvalu'),
('800','UGA','UG','Uganda'),
('804','UKR','UA','Ukraine'),
('784','ARE','AE','United Arab Emirates'),
('826','GBR','GB','United Kingdom of Great Britain and Northern Ireland'),
('840','USA','US','United States of America'),
('581','UMI','UM','United States Minor Outlying Islands'),
('858','URY','UY','Uruguay'),
('860','UZB','UZ','Uzbekistan'),
('548','VUT','VU','Vanuatu'),
('862','VEN','VE','Venezuela (Bolivarian Republic of)'),
('704','VNM','VN','Viet Nam'),
('92','VGB','VG','Virgin Islands (British)'),
('850','VIR','VI','Virgin Islands (U.S.)'),
('876','WLF','WF','Wallis and Futuna'),
('732','ESH','EH','Western Sahara'),
('887','YEM','YE','Yemen'),
('894','ZMB','ZM','Zambia'),
('716','ZWE','ZW','Zimbabwe');

Tab delimited version:

numeric	alpha3	alpha2	name
4	AFG	AF	Afghanistan
248	ALA	AX	Åland Islands
8	ALB	AL	Albania
12	DZA	DZ	Algeria
16	ASM	AS	American Samoa
20	AND	AD	Andorra
24	AGO	AO	Angola
660	AIA	AI	Anguilla
10	ATA	AQ	Antarctica
28	ATG	AG	Antigua and Barbuda
32	ARG	AR	Argentina
51	ARM	AM	Armenia
533	ABW	AW	Aruba
36	AUS	AU	Australia
40	AUT	AT	Austria
31	AZE	AZ	Azerbaijan
44	BHS	BS	Bahamas
48	BHR	BH	Bahrain
50	BGD	BD	Bangladesh
52	BRB	BB	Barbados
112	BLR	BY	Belarus
56	BEL	BE	Belgium
84	BLZ	BZ	Belize
204	BEN	BJ	Benin
60	BMU	BM	Bermuda
64	BTN	BT	Bhutan
68	BOL	BO	Bolivia (Plurinational State of)
535	BES	BQ	Bonaire, Sint Eustatius and Saba
70	BIH	BA	Bosnia and Herzegovina
72	BWA	BW	Botswana
74	BVT	BV	Bouvet Island
76	BRA	BR	Brazil
86	IOT	IO	British Indian Ocean Territory
96	BRN	BN	Brunei Darussalam
100	BGR	BG	Bulgaria
854	BFA	BF	Burkina Faso
108	BDI	BI	Burundi
132	CPV	CV	Cabo Verde
116	KHM	KH	Cambodia
120	CMR	CM	Cameroon
124	CAN	CA	Canada
136	CYM	KY	Cayman Islands
140	CAF	CF	Central African Republic
148	TCD	TD	Chad
152	CHL	CL	Chile
156	CHN	CN	China
162	CXR	CX	Christmas Island
166	CCK	CC	Cocos (Keeling) Islands
170	COL	CO	Colombia
174	COM	KM	Comoros
178	COG	CG	Congo
180	COD	CD	Congo (Democratic Republic of the)
184	COK	CK	Cook Islands
188	CRI	CR	Costa Rica
384	CIV	CI	Côte d'Ivoire
191	HRV	HR	Croatia
192	CUB	CU	Cuba
531	CUW	CW	Curaçao
196	CYP	CY	Cyprus
203	CZE	CZ	Czechia
208	DNK	DK	Denmark
262	DJI	DJ	Djibouti
212	DMA	DM	Dominica
214	DOM	DO	Dominican Republic
218	ECU	EC	Ecuador
818	EGY	EG	Egypt
222	SLV	SV	El Salvador
226	GNQ	GQ	Equatorial Guinea
232	ERI	ER	Eritrea
233	EST	EE	Estonia
231	ETH	ET	Ethiopia
238	FLK	FK	Falkland Islands (Malvinas)
234	FRO	FO	Faroe Islands
242	FJI	FJ	Fiji
246	FIN	FI	Finland
250	FRA	FR	France
254	GUF	GF	French Guiana
258	PYF	PF	French Polynesia
260	ATF	TF	French Southern Territories
266	GAB	GA	Gabon
270	GMB	GM	Gambia
268	GEO	GE	Georgia
276	DEU	DE	Germany
288	GHA	GH	Ghana
292	GIB	GI	Gibraltar
300	GRC	GR	Greece
304	GRL	GL	Greenland
308	GRD	GD	Grenada
312	GLP	GP	Guadeloupe
316	GUM	GU	Guam
320	GTM	GT	Guatemala
831	GGY	GG	Guernsey
324	GIN	GN	Guinea
624	GNB	GW	Guinea-Bissau
328	GUY	GY	Guyana
332	HTI	HT	Haiti
334	HMD	HM	Heard Island and McDonald Islands
336	VAT	VA	Holy See (Vatican City State)
340	HND	HN	Honduras
344	HKG	HK	Hong Kong
348	HUN	HU	Hungary
352	ISL	IS	Iceland
356	IND	IN	India
360	IDN	ID	Indonesia
364	IRN	IR	Iran (Islamic Republic of)
368	IRQ	IQ	Iraq
372	IRL	IE	Ireland
833	IMN	IM	Isle of Man
376	ISR	IL	Israel
380	ITA	IT	Italy
388	JAM	JM	Jamaica
392	JPN	JP	Japan
832	JEY	JE	Jersey
400	JOR	JO	Jordan
398	KAZ	KZ	Kazakhstan
404	KEN	KE	Kenya
296	KIR	KI	Kiribati
408	PRK	KP	Korea, Democratic People's Republic of
410	KOR	KR	Korea, Republic of
414	KWT	KW	Kuwait
417	KGZ	KG	Kyrgyzstan
418	LAO	LA	Lao People's Democratic Republic
428	LVA	LV	Latvia
422	LBN	LB	Lebanon
426	LSO	LS	Lesotho
430	LBR	LR	Liberia
434	LBY	LY	Libya
438	LIE	LI	Liechtenstein
440	LTU	LT	Lithuania
442	LUX	LU	Luxembourg
446	MAC	MO	Macao
807	MKD	MK	Macedonia (the former Yugoslav Republic of)
450	MDG	MG	Madagascar
454	MWI	MW	Malawi
458	MYS	MY	Malaysia
462	MDV	MV	Maldives
466	MLI	ML	Mali
470	MLT	MT	Malta
584	MHL	MH	Marshall Islands
474	MTQ	MQ	Martinique
478	MRT	MR	Mauritania
480	MUS	MU	Mauritius
175	MYT	YT	Mayotte
484	MEX	MX	Mexico
583	FSM	FM	Micronesia, Federated States of
498	MDA	MD	Moldova, Republic of
492	MCO	MC	Monaco
496	MNG	MN	Mongolia
499	MNE	ME	Montenegro
500	MSR	MS	Montserrat
504	MAR	MA	Morocco
508	MOZ	MZ	Mozambique
104	MMR	MM	Myanmar
516	NAM	NA	Namibia
520	NRU	NR	Nauru
524	NPL	NP	Nepal
528	NLD	NL	Netherlands
540	NCL	NC	New Caledonia
554	NZL	NZ	New Zealand
558	NIC	NI	Nicaragua
562	NER	NE	Niger
566	NGA	NG	Nigeria
570	NIU	NU	Niue
574	NFK	NF	Norfolk Island
580	MNP	MP	Northern Mariana Islands
578	NOR	NO	Norway
512	OMN	OM	Oman
586	PAK	PK	Pakistan
585	PLW	PW	Palau
275	PSE	PS	Palestine, State of
591	PAN	PA	Panama
598	PNG	PG	Papua New Guinea
600	PRY	PY	Paraguay
604	PER	PE	Peru
608	PHL	PH	Philippines
612	PCN	PN	Pitcairn
616	POL	PL	Poland
620	PRT	PT	Portugal
630	PRI	PR	Puerto Rico
634	QAT	QA	Qatar
638	REU	RE	Réunion
642	ROU	RO	Romania
643	RUS	RU	Russian Federation
646	RWA	RW	Rwanda
652	BLM	BL	Saint Barthélemy
654	SHN	SH	Saint Helena, Ascension and Tristan da Cunha
659	KNA	KN	Saint Kitts and Nevis
662	LCA	LC	Saint Lucia
663	MAF	MF	Saint Martin (French part)
666	SPM	PM	Saint Pierre and Miquelon
670	VCT	VC	Saint Vincent and the Grenadines
882	WSM	WS	Samoa
674	SMR	SM	San Marino
678	STP	ST	Sao Tome and Principe
682	SAU	SA	Saudi Arabia
686	SEN	SN	Senegal
688	SRB	RS	Serbia
690	SYC	SC	Seychelles
694	SLE	SL	Sierra Leone
702	SGP	SG	Singapore
534	SXM	SX	Sint Maarten (Dutch part)
703	SVK	SK	Slovakia
705	SVN	SI	Slovenia
90	SLB	SB	Solomon Islands
706	SOM	SO	Somalia
710	ZAF	ZA	South Africa
239	SGS	GS	South Georgia and the South Sandwich Islands
728	SSD	SS	South Sudan
724	ESP	ES	Spain
144	LKA	LK	Sri Lanka
729	SDN	SD	Sudan
740	SUR	SR	Suriname
744	SJM	SJ	Svalbard and Jan Mayen
748	SWZ	SZ	Swaziland
752	SWE	SE	Sweden
756	CHE	CH	Switzerland
760	SYR	SY	Syrian Arab Republic
158	TWN	TW	Taiwan, Province of China
762	TJK	TJ	Tajikistan
834	TZA	TZ	Tanzania, United Republic of
764	THA	TH	Thailand
626	TLS	TL	Timor-Leste
768	TGO	TG	Togo
772	TKL	TK	Tokelau
776	TON	TO	Tonga
780	TTO	TT	Trinidad and Tobago
788	TUN	TN	Tunisia
792	TUR	TR	Turkey
795	TKM	TM	Turkmenistan
796	TCA	TC	Turks and Caicos Islands
798	TUV	TV	Tuvalu
800	UGA	UG	Uganda
804	UKR	UA	Ukraine
784	ARE	AE	United Arab Emirates
826	GBR	GB	United Kingdom of Great Britain and Northern Ireland
840	USA	US	United States of America
581	UMI	UM	United States Minor Outlying Islands
858	URY	UY	Uruguay
860	UZB	UZ	Uzbekistan
548	VUT	VU	Vanuatu
862	VEN	VE	Venezuela (Bolivarian Republic of)
704	VNM	VN	Viet Nam
92	VGB	VG	Virgin Islands (British)
850	VIR	VI	Virgin Islands (U.S.)
876	WLF	WF	Wallis and Futuna
732	ESH	EH	Western Sahara
887	YEM	YE	Yemen
894	ZMB	ZM	Zambia
716	ZWE	ZW	Zimbabwe

You May Also Like

About the Author: John

Leave a Reply

Your email address will not be published. Required fields are marked *