Code

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 create a table of abbreviations and names. Hope it saves you some time!

CREATE TABLE `canada` (
`name` VARCHAR( 26 ) NOT NULL ,
`abv` CHAR( 2 ) NOT NULL ,
PRIMARY KEY ( `abv` )
);

INSERT INTO `canada` VALUES ('Alberta', 'AB');
INSERT INTO `canada` VALUES ('British Columbia', 'BC');
INSERT INTO `canada` VALUES ('Manitoba', 'MB');
INSERT INTO `canada` VALUES ('New Brunswick', 'NB');
INSERT INTO `canada` VALUES ('Newfoundland and Labrador', 'NL');
INSERT INTO `canada` VALUES ('Northwest Territories', 'NT');
INSERT INTO `canada` VALUES ('Nova Scotia', 'NS');
INSERT INTO `canada` VALUES ('Nunavut', 'NU');
INSERT INTO `canada` VALUES ('Ontario', 'ON');
INSERT INTO `canada` VALUES ('Prince Edward Island', 'PE');
INSERT INTO `canada` VALUES ('Quebec', 'QC');
INSERT INTO `canada` VALUES ('Saskatchewan', 'SK');
INSERT INTO `canada` VALUES ('Yukon', 'YT');

1 Comment

July 26, 2011, 5:20 pm
Thanks Buddy!

Leave a Comment

Name
Email
Website
Comment
Name and email are required. Your email will not be published.

This post was published on Saturday, September 5th, 2009 by Robert James Reese in the following categories: Data Dumps, MySQL. Before using any of the code or other content in this post, you must read and agree to our Terms & Conditions.

Copyright © 2012, Ink Plant. All rights reserved.