Return to Snippet

Revision: 16370
at August 1, 2009 23:55 by CuDDL


Updated Code
# This will create and then populate a MySQL table with a list of the names and
# ISO code abbreviations for the provinces and territories of Canada.


CREATE TABLE `ca_provinces` (
    `id` TINYINT UNSIGNED NOT NULL AUTO_INCREMENT PRIMARY KEY ,
    `name` VARCHAR( 255 ) NOT NULL ,
    `iso` CHAR( 2 ) NOT NULL
);

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

Revision: 16369
at August 1, 2009 23:55 by CuDDL


Updated Code
# This will create and then populate a MySQL table with a list of the names and
# ISO code abbreviations for the provinces and territories of Canada.


CREATE TABLE `ca_provinces` (
    `id` TINYINT UNSIGNED NOT NULL AUTO_INCREMENT PRIMARY KEY ,
    `name` VARCHAR( 255 ) NOT NULL ,
    `iso` CHAR( 2 ) NOT NULL
);

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

Revision: 16368
at August 1, 2009 23:52 by CuDDL


Initial Code
CREATE TABLE `ca_provinces` (
    `id` TINYINT UNSIGNED NOT NULL AUTO_INCREMENT PRIMARY KEY ,
    `name` VARCHAR( 255 ) NOT NULL ,
    `iso` CHAR( 2 ) NOT NULL
);

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

Initial URL


Initial Description


Initial Title
MySQL Canada Provinces Territories

Initial Tags
mysql, table, list

Initial Language
MySQL