Posted By

simplistik on 09/18/08


Tagged

mysql states utf-8


Versions (?)

Who likes this?

2 people have marked this snippet as a favorite

jimyt
wizard04


50 States & Washington D.C.


 / Published in: SQL
 

Creates a MySQL table with all 50 states + Washington D.C. in alphabetical order.

  1. CREATE TABLE `state` (
  2. `id` tinyint(4) NOT NULL AUTO_INCREMENT,
  3. `name` char(50) NOT NULL DEFAULT '',
  4. `abbreviation` char(2) NOT NULL DEFAULT '',
  5. PRIMARY KEY (`id`)
  6. ) ENGINE=MyISAM AUTO_INCREMENT=52 DEFAULT CHARSET=utf8;
  7.  
  8. INSERT INTO `state` (`id`,`name`,`abbreviation`) VALUES ('1','Alabama','AL');
  9. INSERT INTO `state` (`id`,`name`,`abbreviation`) VALUES ('2','Alaska','AK');
  10. INSERT INTO `state` (`id`,`name`,`abbreviation`) VALUES ('3','Arizona','AZ');
  11. INSERT INTO `state` (`id`,`name`,`abbreviation`) VALUES ('4','Arkansas','AR');
  12. INSERT INTO `state` (`id`,`name`,`abbreviation`) VALUES ('5','California','CA');
  13. INSERT INTO `state` (`id`,`name`,`abbreviation`) VALUES ('6','Colorado','CO');
  14. INSERT INTO `state` (`id`,`name`,`abbreviation`) VALUES ('7','Connecticut','CT');
  15. INSERT INTO `state` (`id`,`name`,`abbreviation`) VALUES ('8','Delaware','DE');
  16. INSERT INTO `state` (`id`,`name`,`abbreviation`) VALUES ('9','District of Columbia','DC');
  17. INSERT INTO `state` (`id`,`name`,`abbreviation`) VALUES ('10','Florida','FL');
  18. INSERT INTO `state` (`id`,`name`,`abbreviation`) VALUES ('11','Georgia','GA');
  19. INSERT INTO `state` (`id`,`name`,`abbreviation`) VALUES ('12','Hawaii','HI');
  20. INSERT INTO `state` (`id`,`name`,`abbreviation`) VALUES ('13','Idaho','ID');
  21. INSERT INTO `state` (`id`,`name`,`abbreviation`) VALUES ('14','Illinois','IL');
  22. INSERT INTO `state` (`id`,`name`,`abbreviation`) VALUES ('15','Indiana','IN');
  23. INSERT INTO `state` (`id`,`name`,`abbreviation`) VALUES ('16','Iowa','IA');
  24. INSERT INTO `state` (`id`,`name`,`abbreviation`) VALUES ('17','Kansas','KS');
  25. INSERT INTO `state` (`id`,`name`,`abbreviation`) VALUES ('18','Kentucky','KY');
  26. INSERT INTO `state` (`id`,`name`,`abbreviation`) VALUES ('19','Louisiana','LA');
  27. INSERT INTO `state` (`id`,`name`,`abbreviation`) VALUES ('20','Maine','ME');
  28. INSERT INTO `state` (`id`,`name`,`abbreviation`) VALUES ('21','Maryland','MD');
  29. INSERT INTO `state` (`id`,`name`,`abbreviation`) VALUES ('22','Massachusetts','MA');
  30. INSERT INTO `state` (`id`,`name`,`abbreviation`) VALUES ('23','Michigan','MI');
  31. INSERT INTO `state` (`id`,`name`,`abbreviation`) VALUES ('24','Minnesota','MN');
  32. INSERT INTO `state` (`id`,`name`,`abbreviation`) VALUES ('25','Mississippi','MS');
  33. INSERT INTO `state` (`id`,`name`,`abbreviation`) VALUES ('26','Missouri','MO');
  34. INSERT INTO `state` (`id`,`name`,`abbreviation`) VALUES ('27','Montana','MT');
  35. INSERT INTO `state` (`id`,`name`,`abbreviation`) VALUES ('28','Nebraska','NE');
  36. INSERT INTO `state` (`id`,`name`,`abbreviation`) VALUES ('29','Nevada','NV');
  37. INSERT INTO `state` (`id`,`name`,`abbreviation`) VALUES ('30','New Hampshire','NH');
  38. INSERT INTO `state` (`id`,`name`,`abbreviation`) VALUES ('31','New Jersey','NJ');
  39. INSERT INTO `state` (`id`,`name`,`abbreviation`) VALUES ('32','New Mexico','NM');
  40. INSERT INTO `state` (`id`,`name`,`abbreviation`) VALUES ('33','New York','NY');
  41. INSERT INTO `state` (`id`,`name`,`abbreviation`) VALUES ('34','North Carolina','NC');
  42. INSERT INTO `state` (`id`,`name`,`abbreviation`) VALUES ('35','North Dakota','ND');
  43. INSERT INTO `state` (`id`,`name`,`abbreviation`) VALUES ('36','Ohio','OH');
  44. INSERT INTO `state` (`id`,`name`,`abbreviation`) VALUES ('37','Oklahoma','OK');
  45. INSERT INTO `state` (`id`,`name`,`abbreviation`) VALUES ('38','Oregon','OR');
  46. INSERT INTO `state` (`id`,`name`,`abbreviation`) VALUES ('39','Pennsylvania','PA');
  47. INSERT INTO `state` (`id`,`name`,`abbreviation`) VALUES ('40','Rhode Island','RI');
  48. INSERT INTO `state` (`id`,`name`,`abbreviation`) VALUES ('41','South Carolina','SC');
  49. INSERT INTO `state` (`id`,`name`,`abbreviation`) VALUES ('42','South Dakota','SD');
  50. INSERT INTO `state` (`id`,`name`,`abbreviation`) VALUES ('43','Tennessee','TN');
  51. INSERT INTO `state` (`id`,`name`,`abbreviation`) VALUES ('44','Texas','TX');
  52. INSERT INTO `state` (`id`,`name`,`abbreviation`) VALUES ('45','Utah','UT');
  53. INSERT INTO `state` (`id`,`name`,`abbreviation`) VALUES ('46','Vermont','VT');
  54. INSERT INTO `state` (`id`,`name`,`abbreviation`) VALUES ('47','Virginia','VA');
  55. INSERT INTO `state` (`id`,`name`,`abbreviation`) VALUES ('48','Washington','WA');
  56. INSERT INTO `state` (`id`,`name`,`abbreviation`) VALUES ('49','West Virginia','WV');
  57. INSERT INTO `state` (`id`,`name`,`abbreviation`) VALUES ('50','Wisconsin','WI');
  58. INSERT INTO `state` (`id`,`name`,`abbreviation`) VALUES ('51','Wyoming','WY');

Report this snippet  

You need to login to post a comment.