Search This Blog

Tuesday 12 February 2013

Magento States list for other countries - Australia, China, Japan, Mexico and United Kingdom

Here are the SQL Queries for states list different countries:

Australia:
INSERT INTO `directory_country_region` VALUES (NULL , "AU", "ACT","Australian Capital Territory"),(NULL , "AU", "NSW","New South Wales"),(NULL , "AU", "NT","Northern Territory"),(NULL , "AU", "QLD","Queensland"),(NULL , "AU", "SA","South Australia"),(NULL , "AU", "TAS","Tasmania"),(NULL , "AU", "VIC","Victoria"),(NULL , "AU", "WA","Western Australia");

INSERT INTO `directory_country_region_name` (`locale` ,`region_id` ,`name` ) SELECT 'en_US', tmp.region_id, tmp.default_name FROM `directory_country_region` AS tmp WHERE tmp.country_id='AU';

China:
INSERT INTO `directory_country_region` VALUES (NULL , "CN", "Heilongjiang Province","Heilongjiang Province"),(NULL , "CN", "Jilin Province","Jilin Province"),(NULL , "CN", "Liaoning Province","Liaoning Province"),(NULL , "CN", "Neimenggu A. R.","Neimenggu A. R."),(NULL , "CN", "Gansu Province","Gansu Province"),(NULL , "CN", "Ningxia A. R.","Ningxia A. R."),(NULL , "CN", "Xinjiang A. R.","Xinjiang A. R."),(NULL , "CN", "Qinghai Province","Qinghai Province"),(NULL , "CN", "Hebei Province","Hebei Province"),(NULL , "CN", "Henan Province","Henan Province"),(NULL , "CN", "Shandong Province","Shandong Province"),(NULL , "CN", "Shanxi Province","Shanxi Province"),(NULL , "CN", "Shaanxi Province","Shaanxi Province"),(NULL , "CN", "Jiangsu Province","Jiangsu Province"),(NULL , "CN", "Zhejiang Province","Zhejiang Province"),(NULL , "CN", "Anhui Province","Anhui Province"),(NULL , "CN", "Hubei  Province","Hubei  Province"),(NULL , "CN", "Hunan Province","Hunan Province"),(NULL , "CN", "Sichuan Province","Sichuan Province"),(NULL , "CN", "Guizhou Province","Guizhou Province"),(NULL , "CN", "Jiangxi  Province","Jiangxi  Province"),(NULL , "CN", "Guangdong Province","Guangdong Province"),(NULL , "CN", "Guangxi A. R.","Guangxi A. R."),(NULL , "CN", "Yunnan Province","Yunnan Province"),(NULL , "CN", "Hainan Province","Hainan Province"),(NULL , "CN", "Xizang A. R.","Xizang A. R."),(NULL , "CN", "Beijing","Beijing"),(NULL , "CN", "Shanghai","Shanghai"),(NULL , "CN", "Tianjin","Tianjin"),(NULL , "CN", "Chongqing","Chongqing"),(NULL , "CN", "Fujian Province","Fujian Province");

INSERT INTO `directory_country_region_name` (`locale` ,`region_id` ,`name` ) SELECT 'en_US', tmp.region_id, tmp.default_name FROM `directory_country_region` AS tmp WHERE tmp.country_id='CN';

Japan:
INSERT INTO `directory_country_region` VALUES (NULL , "JP", "Hokkaido","Hokkaido"),(NULL , "JP", "Aomori","Aomori"),(NULL , "JP", "Iwate","Iwate"),(NULL , "JP", "Miyagi","Miyagi"),(NULL , "JP", "Akita","Akita"),(NULL , "JP", "Yamagata","Yamagata"),(NULL , "JP", "Fukushima","Fukushima"),(NULL , "JP", "Ibaraki","Ibaraki"),(NULL , "JP", "Tochigi","Tochigi"),(NULL , "JP", "Gunma","Gunma"),(NULL , "JP", "Saitama","Saitama"),(NULL , "JP", "Chiba","Chiba"),(NULL , "JP", "Tokyo","Tokyo"),(NULL , "JP", "Kanagawa","Kanagawa"),(NULL , "JP", "Niigata","Niigata"),(NULL , "JP", "Toyama","Toyama"),(NULL , "JP", "Ishikawa","Ishikawa"),(NULL , "JP", "Fukui","Fukui"),(NULL , "JP", "Yamanashi","Yamanashi"),(NULL , "JP", "Nagano","Nagano"),(NULL , "JP", "Gifu","Gifu"),(NULL , "JP", "Shizuoka","Shizuoka"),(NULL , "JP", "Aichi","Aichi"),(NULL , "JP", "Mie","Mie"),(NULL , "JP", "Shiga","Shiga"),(NULL , "JP", "Kyoto","Kyoto"),(NULL , "JP", "Osaka","Osaka"),(NULL , "JP", "Hyogo","Hyogo"),(NULL , "JP", "Nara","Nara"),(NULL , "JP", "Wakayama","Wakayama"),(NULL , "JP", "Tottori","Tottori"),(NULL , "JP", "Shimane","Shimane"),(NULL , "JP", "Okayama","Okayama"),(NULL , "JP", "Hiroshima","Hiroshima"),(NULL , "JP", "Yamaguchi","Yamaguchi"),(NULL , "JP", "Tokushima","Tokushima"),(NULL , "JP", "Kagawa","Kagawa"),(NULL , "JP", "Ehime","Ehime"),(NULL , "JP", "Kochi","Kochi"),(NULL , "JP", "Fukuoka","Fukuoka"),(NULL , "JP", "Saga","Saga"),(NULL , "JP", "Nagasaki","Nagasaki"),(NULL , "JP", "Kumamoto","Kumamoto"),(NULL , "JP", "Oita","Oita"),(NULL , "JP", "Miyazaki","Miyazaki"),(NULL , "JP", "Kagoshima","Kagoshima"),(NULL , "JP", "Okinawa","Okinawa");

INSERT INTO `directory_country_region_name` (`locale` ,`region_id` ,`name` ) SELECT 'en_US', tmp.region_id, tmp.default_name FROM `directory_country_region` AS tmp WHERE tmp.country_id='JP';

Mexico:
INSERT INTO `directory_country_region` VALUES (NULL , "MX", "AGS","Aguascalientes"),(NULL , "MX", "BCN","Baja California Norte"),(NULL , "MX", "BCS","Baja California Sur"),(NULL , "MX", "CAM","Campeche"),(NULL , "MX", "CHIS","Chiapas"),(NULL , "MX", "CHIH","Chihuahua"),(NULL , "MX", "COAH","Coahuila"),(NULL , "MX", "COL","Colima"),(NULL , "MX", "DF","Distrito Federal"),(NULL , "MX", "DGO","Durango"),(NULL , "MX", "GTO","Guanajuato"),(NULL , "MX", "GRO","Guerrero"),(NULL , "MX", "HGO","Hidalgo"),(NULL , "MX", "JAL","Jalisco"),(NULL , "MX", "MICH","Michoacan"),(NULL , "MX", "MOR","Morelos"),(NULL , "MX", "MEX","Mexico (Estado de)"),(NULL , "MX", "NAY","Nayarit"),(NULL , "MX", "NL","Nuevo Leon"),(NULL , "MX", "OAX","Oaxaca"),(NULL , "MX", "PUE","Puebla"),(NULL , "MX", "QRO","Queretaro"),(NULL , "MX", "QROO","Quintana Roo"),(NULL , "MX", "SLP","San Luis Potosi"),(NULL , "MX", "SIN","Sinaloa"),(NULL , "MX", "SON","Sonora"),(NULL , "MX", "TAB","Tabasco"),(NULL , "MX", "TAMPS","Tamaulipas"),(NULL , "MX", "TLAX","Tlaxcala"),(NULL , "MX", "VER","Veracruz"),(NULL , "MX", "YUC","Yucatan"),(NULL , "MX", "ZAC","Zacatecas");

INSERT INTO `directory_country_region_name` (`locale` ,`region_id` ,`name` ) SELECT 'en_US', tmp.region_id, tmp.default_name FROM `directory_country_region` AS tmp WHERE tmp.country_id='MX';

United Kingdom:
INSERT INTO `directory_country_region` VALUES (NULL , "GB", "Aberdeenshire","Aberdeenshire"),(NULL , "GB", "Angus","Angus"),(NULL , "GB", "Argyll","Argyll"),(NULL , "GB", "Avon","Avon"),(NULL , "GB", "Ayrshire","Ayrshire"),(NULL , "GB", "Banffshire","Banffshire"),(NULL , "GB", "Beds.","Bedfordshire"),(NULL , "GB", "Berks.","Berkshire"),(NULL , "GB", "Berwickshire","Berwickshire"),(NULL , "GB", "Bucks.","Buckinghamshire"),(NULL , "GB", "Caithness","Caithness"),(NULL , "GB", "Cambs.","Cambridgeshire"),(NULL , "GB", "Ches.","Cheshire"),(NULL , "GB", "Clackmannanshire","Clackmannanshire"),(NULL , "GB", "Cleveland","Cleveland"),(NULL , "GB", "Clwyd","Clwyd"),(NULL , "GB", "Cornwall","Cornwall"),(NULL , "GB", "Co Antrim","Country Antrim"),(NULL , "GB", "Co Armagh","Country Armagh"),(NULL , "GB", "Co Down","County Down"),(NULL , "GB", "Durham","Country Durham"),(NULL , "GB", "Co Fermanagh","County Fermanagh"),(NULL , "GB", "Co Londonderry","County Londonderry"),(NULL , "GB", "Co Tyrone","County Tyrone"),(NULL , "GB", "Cumbria","Cumbria"),(NULL , "GB", "Derbys.","Derbyshire"),(NULL , "GB", "Devon","Devon"),(NULL , "GB", "Dorset","Dorset"),(NULL , "GB", "Dumfriesshire","Dumfriesshire"),(NULL , "GB", "Dunbartonshire","Dunbartonshire"),(NULL , "GB", "Dyfed","Dyfed"),(NULL , "GB", "E Lothian","East Lothian"),(NULL , "GB", "E Sussex","East Sussex"),(NULL , "GB", "Essex","Essex"),(NULL , "GB", "Fife","Fife"),(NULL , "GB", "Gloucs.","Gloucestershire"),(NULL , "GB", "London","Greater London"),(NULL , "GB", "Gwent","Gwent"),(NULL , "GB", "Gwynedd","Gwynedd"),(NULL , "GB", "Hants.","Hampshire"),(NULL , "GB", "Hereford","Herefordshire"),(NULL , "GB", "Herts.","Hertfordshire"),(NULL , "GB", "Inverness-shire","Inverness-shire"),(NULL , "GB", "Isle of Arran","Isle of Arran"),(NULL , "GB", "Isle of Barra","Isle of Barra"),(NULL , "GB", "Isle of Benbecula","Isle of Benbecula"),(NULL , "GB", "Isle of Bute","Isle of Bute"),(NULL , "GB", "Isle of Canna","Isle of Canna"),(NULL , "GB", "Isle of Coll","Isle of Coll"),(NULL , "GB", "Isle of Colonsay","Isle of Colonsay"),(NULL , "GB", "Isle of Cumbrae","Isle of Cumbrae"),(NULL , "GB", "Isle of Eigg","Isle of Eigg"),(NULL , "GB", "Isle of Gigha","Isle of Gigha"),(NULL , "GB", "Isle of Harris","Isle of Harris"),(NULL , "GB", "Isle of Iona","Isle of Iona"),(NULL , "GB", "Isle of Islay","Isle of Islay"),(NULL , "GB", "Isle of Jura","Isle of Jura"),(NULL , "GB", "Isle of Lewis","Isle of Lewis"),(NULL , "GB", "Isle of Mull","Isle of Mull"),(NULL , "GB", "Isle of North Uist","Isle of North Uist"),(NULL , "GB", "Isle of Rum","Isle of Rum"),(NULL , "GB", "Isle of Scalpay","Isle of Scalpay"),(NULL , "GB", "Isle of Skye","Isle of Skye"),(NULL , "GB", "Isle of South Uist","Isle of South Uist"),(NULL , "GB", "Isle of Tiree","Isle of Tiree"),(NULL , "GB", "Isle of Wight","Isle of Wight"),(NULL , "GB", "Kent","Kent"),(NULL , "GB", "Kincardineshire","Kincardineshire"),(NULL , "GB", "Kinross-shire","Kinross-shire"),(NULL , "GB", "Kirkcudbrightshire","Kirkcudbrightshire"),(NULL , "GB", "Lancarkshire","Lancarkshire"),(NULL , "GB", "Lancs.","Lancashire"),(NULL , "GB", "Leics.","Leicestershire"),(NULL , "GB", "Lincs.","Lincolnshire"),(NULL , "GB", "Merseyside","Merseyside"),(NULL , "GB", "M Glam","Mid Glamorgan"),(NULL , "GB", "Mid Lothian","Mid Lothian"),(NULL , "GB", "Middx.","Middlesex"),(NULL , "GB", "Morayshire","Morayshire"),(NULL , "GB", "Nairnshire","Nairnshire"),(NULL , "GB", "Norfolk","Norfolk"),(NULL , "GB", "N Humberside","North Humberside"),(NULL , "GB", "N Yorkshire","North Yorkshire"),(NULL , "GB", "Northants.","Northamptonshire"),(NULL , "GB", "Northumberland","Northumberland"),(NULL , "GB", "Notts.","Nottinghamshire"),(NULL , "GB", "Oxon.","Oxfordshire"),(NULL , "GB", "Peeblesshire","Peeblesshire"),(NULL , "GB", "Perthshire","Perthshire"),(NULL , "GB", "Powys","Powys"),(NULL , "GB", "Renfrewshire","Renfrewshire"),(NULL , "GB", "Ross-shire","Ross-shire"),(NULL , "GB", "Roxburghshire","Roxburghshire"),(NULL , "GB", "Selkirkshire","Selkirkshire"),(NULL , "GB", "Shrops","Shropshire"),(NULL , "GB", "Somt.","Somerset"),(NULL , "GB", "S Glam","South Glamorgan"),(NULL , "GB", "S Humberside","South Humberside"),(NULL , "GB", "S Yorkshire","South Yorkshire"),(NULL , "GB", "Staffs.","Staffordshire"),(NULL , "GB", "Stirlingshire","Stirlingshire"),(NULL , "GB", "Suffolk","Suffolk"),(NULL , "GB", "Surrey","Surrey"),(NULL , "GB", "Sutherland","Sutherland"),(NULL , "GB", "Tyne & Wear","Tyne and Wear"),(NULL , "GB", "Warks","Warwickshire"),(NULL , "GB", "W Glam","West Glamorgan"),(NULL , "GB", "W Lothian","West Lothian"),(NULL , "GB", "W Midlands","West Midlands"),(NULL , "GB", "W Sussex","West Sussex"),(NULL , "GB", "W Yorkshire","West Yorkshire"),(NULL , "GB", "Wigtownshire","Wigtownshire"),(NULL , "GB", "Wilts","Wiltshire"),(NULL , "GB", "Worcs","Worcestershire");

INSERT INTO `directory_country_region_name` (`locale` ,`region_id` ,`name` ) SELECT 'en_US', tmp.region_id, tmp.default_name FROM `directory_country_region` AS tmp WHERE tmp.country_id='GB';

Note: You might need to change the table name if you have any table prefix in your Magento installation.

5 comments:

  1. you are my favourite person in all of india. thankyou for this.

    ReplyDelete
  2. Reeaaaaaally useful !
    Thanks a lot !

    ReplyDelete
  3. Do you have the list for Brazil?

    ReplyDelete
  4. I ended up writing the SQL queries for Brazil.

    INSERT INTO `directory_country_region` VALUES (NULL , "BR", "AC", "Acre"),(NULL , "BR", "AL", "Alagoas"),(NULL , "BR", "AP", "Amapa"),(NULL , "BR", "AM", "Amazonas"),(NULL , "BR", "BA", "Bahia"),(NULL , "BR", "CE", "Ceara"),(NULL , "BR", "DF", "Distrito Federal"),(NULL , "BR", "ES", "Espirito Santo"),(NULL , "BR", "GO", "Goias"),(NULL , "BR", "MA", "Maranhao"),(NULL , "BR", "MT", "Mato Grosso"),(NULL , "BR", "MS", "Mato Grosso do Sul"),(NULL , "BR", "MG", "Minas Gerais"),(NULL , "BR", "PA", "Para"),(NULL , "BR", "PB", "Paraiba"),(NULL , "BR", "PR", "Parana"),(NULL , "BR", "PE", "Pernambuco"),(NULL , "BR", "PI", "Piaui"),(NULL , "BR", "RJ", "Rio de Janeiro"),(NULL , "BR", "RN", "Rio Grande do Norte"),(NULL , "BR", "RS", "Rio Grande do Sul"),(NULL , "BR", "RO", "Rondonia"),(NULL , "BR", "RR", "Roraima"),(NULL , "BR", "SC", "Santa Catarina"),(NULL , "BR", "SP", "Sao Paulo"),(NULL , "BR", "SE", "Sergipe"),(NULL , "BR", "TO", "Tocantins")

    INSERT INTO `directory_country_region_name` (`locale` ,`region_id` ,`name` ) SELECT 'en_US', tmp.region_id, tmp.default_name FROM `directory_country_region` AS tmp WHERE tmp.country_id='BR';

    ReplyDelete
  5. Great blog. All posts have something to learn. Your work is very good and i appreciate you and hoping for some more informative posts.keep writing
    magento development company in bangalore 

    ReplyDelete