Skip to content

Instantly share code, notes, and snippets.

@philoushka
Last active August 6, 2019 03:08
Show Gist options
  • Save philoushka/ff2c845983ac84edc78e to your computer and use it in GitHub Desktop.
Save philoushka/ff2c845983ac84edc78e to your computer and use it in GitHub Desktop.
SQL script to create Mexican States
declare @CountryID int;
select @CountryID = ID
from Country
where Abbr = 'MEX'
--load up this country with its states
insert into [State] (CountryID, [Name], Abbr) values (@CountryID, 'Aguascalientes', 'AGU');
insert into [State] (CountryID, [Name], Abbr) values (@CountryID, 'Baja California', 'BCN');
insert into [State] (CountryID, [Name], Abbr) values (@CountryID, 'Baja California Sur', 'BCS');
insert into [State] (CountryID, [Name], Abbr) values (@CountryID, 'Campeche', 'CAM');
insert into [State] (CountryID, [Name], Abbr) values (@CountryID, 'Chiapas', 'CHP');
insert into [State] (CountryID, [Name], Abbr) values (@CountryID, 'Chihuahua', 'CHH');
insert into [State] (CountryID, [Name], Abbr) values (@CountryID, 'Coahuila', 'COA');
insert into [State] (CountryID, [Name], Abbr) values (@CountryID, 'Colima', 'COL');
insert into [State] (CountryID, [Name], Abbr) values (@CountryID, 'Distrito Federal', 'DIF');
insert into [State] (CountryID, [Name], Abbr) values (@CountryID, 'Durango', 'DUR');
insert into [State] (CountryID, [Name], Abbr) values (@CountryID, 'Guanajuato', 'GUA');
insert into [State] (CountryID, [Name], Abbr) values (@CountryID, 'Guerrero', 'GRO');
insert into [State] (CountryID, [Name], Abbr) values (@CountryID, 'Hidalgo', 'HID');
insert into [State] (CountryID, [Name], Abbr) values (@CountryID, 'Jalisco', 'JAL');
insert into [State] (CountryID, [Name], Abbr) values (@CountryID, 'México', 'MEX');
insert into [State] (CountryID, [Name], Abbr) values (@CountryID, 'Michoacán', 'MIC');
insert into [State] (CountryID, [Name], Abbr) values (@CountryID, 'Morelos', 'MOR');
insert into [State] (CountryID, [Name], Abbr) values (@CountryID, 'Nayarit', 'NAY');
insert into [State] (CountryID, [Name], Abbr) values (@CountryID, 'Nuevo León', 'NLE');
insert into [State] (CountryID, [Name], Abbr) values (@CountryID, 'Oaxaca', 'OAX');
insert into [State] (CountryID, [Name], Abbr) values (@CountryID, 'Puebla', 'PUE');
insert into [State] (CountryID, [Name], Abbr) values (@CountryID, 'Querétaro', 'QUE');
insert into [State] (CountryID, [Name], Abbr) values (@CountryID, 'Quintana Roo', 'ROO');
insert into [State] (CountryID, [Name], Abbr) values (@CountryID, 'San Luis Potosí', 'SLP');
insert into [State] (CountryID, [Name], Abbr) values (@CountryID, 'Sinaloa', 'SIN');
insert into [State] (CountryID, [Name], Abbr) values (@CountryID, 'Sonora', 'SON');
insert into [State] (CountryID, [Name], Abbr) values (@CountryID, 'Tabasco', 'TAB');
insert into [State] (CountryID, [Name], Abbr) values (@CountryID, 'Tamaulipas', 'TAM');
insert into [State] (CountryID, [Name], Abbr) values (@CountryID, 'Tlaxcala', 'TLA');
insert into [State] (CountryID, [Name], Abbr) values (@CountryID, 'Veracruz', 'VER');
insert into [State] (CountryID, [Name], Abbr) values (@CountryID, 'Yucatán', 'YUC');
insert into [State] (CountryID, [Name], Abbr) values (@CountryID, 'Zacatecas', 'ZAC');
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment