About Syngin

Syngin's Blog:
Blog Index

Previous Blog Posts:

  • Temperamental Hard Drives

     

    Blog Powered by:
    Powered by Blogger



    Hosted by:

    Igloo Computing

     
    Syngin's_Blog:  
     
    General musings of the PHP Poet, Syngin.


    Saturday, June 26, 2004

    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:

    .
    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.

    1 Comments:
    Tazzy said...

    Thanks this is something I have rebuilt a dozen times!

    5:52 AM  

    Post a Comment

    Home

     

     
    Home