Canadian Provinces in MySQL Table
I posted a list of U.S. State Abbreviations up here a while ago, then found myself needing the Canadian provinces as well. Here's the MySQL code to easily add them to that table of abbreviations and names. Hope it saves you some time!
CREATE TABLE IF NOT EXISTS `geo_states` ( `name` varchar(50) NOT NULL DEFAULT '', `abv` char(2) NOT NULL DEFAULT '', `country` char(2) NOT NULL, `latitude` decimal(9,6) DEFAULT NULL, `longitude` decimal(9,6) DEFAULT NULL, `slug` varchar(50) NOT NULL, ) ENGINE=MyISAM DEFAULT CHARSET=utf8; INSERT INTO `geo_states` (`name`, `abv`, `country`, `slug`) VALUES ('Alberta','AB','CA','alberta'); ('British Columbia','BC','CA','british-columbia'); ('Manitoba','MB','CA','manitoba'); ('New Brunswick','NB','CA','new-brunswick'); ('Newfoundland and Labrador','NL','CA','newfoundland-and-labrador'); ('Northwest Territories','NT','CA','northwest-territories'); ('Nova Scotia','NS','CA','nova-scotia'); ('Nunavut','NU','CA','nunavut'); ('Ontario','ON','CA','ontario'); ('Prince Edward Island','PE','CA','prince-edward-island'); ('Quebec','QC','CA','quebec'); ('Saskatchewan','SK','CA','saskatchewan'); ('Yukon','YT','CA','yukon'); ALTER TABLE `geo_states` ADD PRIMARY KEY (`abv`,`country`);
This data can also be found in our combined countries, states, provinces, and oceans MySQL dump. There is also a collection of Countries MySQL data posted here on the blog.