Posted By

CuDDL on 08/01/09


Tagged

mysql insert table list create canada Provinces Territories


Versions (?)

Who likes this?

2 people have marked this snippet as a favorite

megadeth_tom
virendrakryadav


MySQL Canada Provinces Territories


 / Published in: MySQL
 

  1. # This will create and then populate a MySQL table with a list of the names and
  2. # ISO code abbreviations for the provinces and territories of Canada.
  3.  
  4.  
  5. CREATE TABLE `ca_provinces` (
  6. `id` TINYINT UNSIGNED NOT NULL AUTO_INCREMENT PRIMARY KEY ,
  7. `name` VARCHAR( 255 ) NOT NULL ,
  8. `iso` CHAR( 2 ) NOT NULL
  9. );
  10.  
  11. INSERT INTO `ca_provinces` (`id`, `name`, `iso`)
  12. VALUES
  13. (NULL, 'Alberta', 'AB'),
  14. (NULL, 'British Columbia', 'BC'),
  15. (NULL, 'Manitoba', 'MB'),
  16. (NULL, 'New Brunswick', 'NB'),
  17. (NULL, 'Newfoundland and Labrador', 'NL'),
  18. (NULL, 'Northwest Territories', 'NT'),
  19. (NULL, 'Nova Scotia', 'NS'),
  20. (NULL, 'Nunavut', 'NU'),
  21. (NULL, 'Ontario', 'ON'),
  22. (NULL, 'Prince Edward Island', 'PE'),
  23. (NULL, 'Quebec', 'QC'),
  24. (NULL, 'Saskatchewan', 'SK'),
  25. (NULL, 'Yukon', 'YT');

Report this snippet  

You need to login to post a comment.