MySQL Canada Provinces Table (SQL)
For anyone who needs the MySQL SQL statement for creating a Canadian provinces table and populating it, here it is:
.
I've built this from scratch multiple times which can be a real waste of time. I hope it comes in handy for someone. The above link goes to a US States version of this table.
.
DROP TABLE IF EXISTS `provinces`;
CREATE TABLE `provinces` (
`id` int(11) NOT NULL auto_increment,
`name` char(40) NOT NULL default '',
`abbrev` char(2) NOT NULL default '',
PRIMARY KEY (`id`)
) TYPE=MyISAM;
INSERT INTO `provinces` VALUES (NULL,'Alberta','AB'),(NULL,'British Columbia','BC'),(NULL,'Manitoba','MB'),(NULL,'New Brunswick','NB'),(NULL,'Newfoundland / Labrador','NL'),(NULL,'Nova Scotia','NS'),(NULL,'Northwest Territories','NW'),(NULL,'Nunavut','NU'),(NULL,'Ontario','ON'),(NULL,'Prince Edward Island','PE'),(NULL,'Quebec','QC'),(NULL,'Saskatchewan','SK'),(NULL,'Yukon','YT');
I've built this from scratch multiple times which can be a real waste of time. I hope it comes in handy for someone. The above link goes to a US States version of this table.






Thanks this is something I have rebuilt a dozen times!
5:52 AM
Post a Comment
Home