Advertisement
wearsunscr33n

SQL - states & provinces

Jun 10th, 2013
76
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 6.20 KB | None | 0 0
  1. CREATE TABLE `countries` (
  2. `id` smallint(5) unsigned NOT NULL auto_increment,
  3. `name` varchar(40) NOT NULL,
  4. `abbreviation` varchar(4) NOT NULL,
  5. PRIMARY KEY (`id`)
  6. ) ENGINE=MyISAM AUTO_INCREMENT=1 DEFAULT CHARSET=utf8 AUTO_INCREMENT=1 ;
  7.  
  8. CREATE TABLE `states` (
  9. `id` smallint(5) unsigned NOT NULL auto_increment,
  10. `country_id` smallint(5) unsigned NOT NULL,
  11. `name` varchar(100) NOT NULL,
  12. `abbreviation` varchar(3) NOT NULL,
  13. PRIMARY KEY (`id`)
  14. ) ENGINE=MyISAM AUTO_INCREMENT=1 DEFAULT CHARSET=utf8 AUTO_INCREMENT=1 ;
  15.  
  16. INSERT INTO countries (name, abbreviation) VALUES ('Canada', 'CAN');
  17. INSERT INTO countries (name, abbreviation) VALUES ('United States of America', 'USA');
  18.  
  19. INSERT INTO states (country_id, name, abbreviation) VALUES ('1', 'Alberta', 'AB');
  20. INSERT INTO states (country_id, name, abbreviation) VALUES ('1', 'British Columbia', 'BC');
  21. INSERT INTO states (country_id, name, abbreviation) VALUES ('1', 'Manitoba', 'MB');
  22. INSERT INTO states (country_id, name, abbreviation) VALUES ('1', 'New Brunswick', 'NB');
  23. INSERT INTO states (country_id, name, abbreviation) VALUES ('1', 'Newfoundland and Labrador', 'NL');
  24. INSERT INTO states (country_id, name, abbreviation) VALUES ('1', 'Northwest Territories', 'NT');
  25. INSERT INTO states (country_id, name, abbreviation) VALUES ('1', 'Nova Scotia', 'NS');
  26. INSERT INTO states (country_id, name, abbreviation) VALUES ('1', 'Nunavut', 'NU');
  27. INSERT INTO states (country_id, name, abbreviation) VALUES ('1', 'Ontario', 'ON');
  28. INSERT INTO states (country_id, name, abbreviation) VALUES ('1', 'Prince Edward Island', 'PE');
  29. INSERT INTO states (country_id, name, abbreviation) VALUES ('1', 'Québec', 'QC');
  30. INSERT INTO states (country_id, name, abbreviation) VALUES ('1', 'Saskatchewan', 'SK');
  31. INSERT INTO states (country_id, name, abbreviation) VALUES ('1', 'Yukon Territory', 'YT');
  32.  
  33.  
  34. INSERT INTO states (country_id, name, abbreviation) VALUES ('2', 'Alaska', 'AK');
  35. INSERT INTO states (country_id, name, abbreviation) VALUES ('2', 'Alabama', 'AL');
  36. INSERT INTO states (country_id, name, abbreviation) VALUES ('2', 'Arizona', 'AZ');
  37. INSERT INTO states (country_id, name, abbreviation) VALUES ('2', 'Arkansas', 'AR');
  38. INSERT INTO states (country_id, name, abbreviation) VALUES ('2', 'California', 'CA');
  39. INSERT INTO states (country_id, name, abbreviation) VALUES ('2', 'Colorado', 'CO');
  40. INSERT INTO states (country_id, name, abbreviation) VALUES ('2', 'Connecticut', 'CT');
  41. INSERT INTO states (country_id, name, abbreviation) VALUES ('2', 'Delaware', 'DE');
  42. INSERT INTO states (country_id, name, abbreviation) VALUES ('2', 'District of Columbia', 'DC');
  43. INSERT INTO states (country_id, name, abbreviation) VALUES ('2', 'Florida', 'FL');
  44. INSERT INTO states (country_id, name, abbreviation) VALUES ('2', 'Georgia', 'GA');
  45. INSERT INTO states (country_id, name, abbreviation) VALUES ('2', 'Hawaii', 'HI');
  46. INSERT INTO states (country_id, name, abbreviation) VALUES ('2', 'Idaho', 'ID');
  47. INSERT INTO states (country_id, name, abbreviation) VALUES ('2', 'Illinois', 'IL');
  48. INSERT INTO states (country_id, name, abbreviation) VALUES ('2', 'Indiana', 'IN');
  49. INSERT INTO states (country_id, name, abbreviation) VALUES ('2', 'Iowa', 'IA');
  50. INSERT INTO states (country_id, name, abbreviation) VALUES ('2', 'Kansas', 'KS');
  51. INSERT INTO states (country_id, name, abbreviation) VALUES ('2', 'Kentucky', 'KY');
  52. INSERT INTO states (country_id, name, abbreviation) VALUES ('2', 'Louisiana', 'LA');
  53. INSERT INTO states (country_id, name, abbreviation) VALUES ('2', 'Maine', 'ME');
  54. INSERT INTO states (country_id, name, abbreviation) VALUES ('2', 'Maryland', 'MD');
  55. INSERT INTO states (country_id, name, abbreviation) VALUES ('2', 'Massachusetts', 'MA');
  56. INSERT INTO states (country_id, name, abbreviation) VALUES ('2', 'Michigan', 'MI');
  57. INSERT INTO states (country_id, name, abbreviation) VALUES ('2', 'Minnesota', 'MN');
  58. INSERT INTO states (country_id, name, abbreviation) VALUES ('2', 'Mississippi', 'MS');
  59. INSERT INTO states (country_id, name, abbreviation) VALUES ('2', 'Missouri', 'MO');
  60. INSERT INTO states (country_id, name, abbreviation) VALUES ('2', 'Montana', 'MT');
  61. INSERT INTO states (country_id, name, abbreviation) VALUES ('2', 'Nebraska', 'NE');
  62. INSERT INTO states (country_id, name, abbreviation) VALUES ('2', 'Nevada', 'NV');
  63. INSERT INTO states (country_id, name, abbreviation) VALUES ('2', 'New Hampshire', 'NH');
  64. INSERT INTO states (country_id, name, abbreviation) VALUES ('2', 'New Jersey', 'NJ');
  65. INSERT INTO states (country_id, name, abbreviation) VALUES ('2', 'New Mexico', 'NM');
  66. INSERT INTO states (country_id, name, abbreviation) VALUES ('2', 'New York', 'NY');
  67. INSERT INTO states (country_id, name, abbreviation) VALUES ('2', 'North Carolina', 'NC');
  68. INSERT INTO states (country_id, name, abbreviation) VALUES ('2', 'North Dakota', 'ND');
  69. INSERT INTO states (country_id, name, abbreviation) VALUES ('2', 'Ohio', 'OH');
  70. INSERT INTO states (country_id, name, abbreviation) VALUES ('2', 'Oklahoma', 'OK');
  71. INSERT INTO states (country_id, name, abbreviation) VALUES ('2', 'Oregon', 'OR');
  72. INSERT INTO states (country_id, name, abbreviation) VALUES ('2', 'Pennsylvania', 'PA');
  73. INSERT INTO states (country_id, name, abbreviation) VALUES ('2', 'Puerto Rico', 'PR');
  74. INSERT INTO states (country_id, name, abbreviation) VALUES ('2', 'Rhode Island', 'RI');
  75. INSERT INTO states (country_id, name, abbreviation) VALUES ('2', 'South Carolina', 'SC');
  76. INSERT INTO states (country_id, name, abbreviation) VALUES ('2', 'South Dakota', 'SD');
  77. INSERT INTO states (country_id, name, abbreviation) VALUES ('2', 'Tennessee', 'TN');
  78. INSERT INTO states (country_id, name, abbreviation) VALUES ('2', 'Texas', 'TX');
  79. INSERT INTO states (country_id, name, abbreviation) VALUES ('2', 'Utah', 'UT');
  80. INSERT INTO states (country_id, name, abbreviation) VALUES ('2', 'Vermont', 'VT');
  81. INSERT INTO states (country_id, name, abbreviation) VALUES ('2', 'Virginia', 'VA');
  82. INSERT INTO states (country_id, name, abbreviation) VALUES ('2', 'Washington', 'WA');
  83. INSERT INTO states (country_id, name, abbreviation) VALUES ('2', 'West Virginia', 'WV');
  84. INSERT INTO states (country_id, name, abbreviation) VALUES ('2', 'Wisconsin', 'WI');
  85. INSERT INTO states (country_id, name, abbreviation) VALUES ('2', 'Wyoming', 'WY');
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement