ClubEnsayos.com - Ensayos de Calidad, Tareas y Monografias
Buscar

Create database empresa


Enviado por   •  12 de Junio de 2013  •  Informe  •  254 Palabras (2 Páginas)  •  338 Visitas

Página 1 de 2

Create database empresa;

use empresa;

CREATE TABLE

REGION(

REG_ID int,

REG_NOM varchar(100),

PRIMARY KEY(REG_ID)

);

CREATE TABLE

PROVINCIA(

PRO_ID int,

PRO_NOM varchar(100),

PRO_REG_ID int,

PRIMARY KEY(PRO_ID)

);

CREATE TABLE

COMUNA(

COM_ID int,

COM_NOM varchar(100),

COM_PRO_ID int,

PRIMARY KEY(COM_ID)

);

Script poblamiento de tablas:

INSERT INTO REGION VALUES

(1000,'Region de Tarapaca'),

(2000,'Region de Antofagasta'),

(3000,'Region de Atacama'),

(4000,'Region de Coquimbo'),

(5000,'Region de Valparaiso'),

(6000,'Region del libertador General Bernardo O´higgins'),

(7000,'Region del Maule'),

(8000,'Region del Bio-Bio'),

(9000,'Region de la Araucania'),

(10000,'Region de los Lagos'),

(11000,'Region de Aysen del General Carlos Ibañez del Campo'),

(12000,'Region de Magallanes y la Antartica Chilena'),

(13000,'Region Metropolitana de Santiago'),

(14000,'Region de los Rios'),

(15000,'Region de Arica y Parinacota');

INSERT INTO PROVINCIA VALUES

(1100,'Iquique',1000),

(2100,'Antofagasta',2000),

(2200,'El Loa',2000),

(2300,'Tocopilla',2000),

(3100,'Copiapó',3000),

(3200,'Chañaral',3000),

(3300,'Huasco',3000),

(4100,'Elqui',4000),

(4200,'Choapa',4000),

(4300,'Limarí',4000),

(5100,'Valparaíso',5000),

(5200,'Isla de Pascua',5000),

(5300,'Los Andes',5000),

(5400,'Petorca',5000),

(5500,'Quillota',5000),

(5600,'San Antonio',5000),

(5700,'San Felipe de Aconcagua',5000),

(6100,'Cachapoal',6000),

(6200,'Cardenal Caro',6000),

(6300,'Colchagua',6000),

(7100,'Talca',7000),

(7200,'Cauquenes',7000),

(7300,'Curicó',7000),

(7400,'Linares',7000),

(8100,'Concepción',8000),

(8200,'Arauco',8000),

(8300,'Biobío',8000),

(8400,'Ñuble',8000),

(9100,'Cautín',9000),

(9200,'Malleco',9000),

(10100,'Llanquihue',10000),

(10200,'Chiloé',10000),

(10300,'Osorno',10000),

(10400,'Palena',10000),

(11100,'Coihaique',11000),

(11200,'Aisén',11000),

(11300,'Capitán Prat',11000),

(11400,'General Carrera',11000),

(12100,'Magallanes',12000),

(12200,'Antártica Chilena',12000),

(12300,'Tierra del Fuego',12000),

(12400,'Última Esperanza',12000),

(13100,'Santiago',13000),

(13200,'Cordillera',13000),

(13300,'Chacabuco',13000),

(13400,'Maipo',13000),

(13500,'Melipilla',13000),

(13600,'Talagante',13000),

(14100,'Valdivia',14000),

(14200,'Ranco',14000),

(15100,'Arica',15000),

(15200,'Parinacota',15000);

INSERT INTO COMUNA VALUES

(1101,'Iquique',1100),

(1102,'Camiña',1100),

(1103,'Colchane',1100),

(1104,'Huara',1100),

(1105,'Pica',1100),

(1106,'Pozo Almonte',1100),

(2101,'Antofagasta',2100),

(2102,'Mejillones',2100),

(2103,'Sierra Gorda',2100),

(2104,'Taltal',2100),

(2201,'Calama',2200),

(2202,'Ollagüe',2200),

(2203,'San Pedro de Atacama',2200),

(2301,'Tocopilla',2300),

(2302,'María Elena',2300),

(3101,'Copiapó',3100),

(3102,'Caldera',3100),

(3103,'Tierra Amarilla',3100),

(3201,'Chañaral',3200),

(3202,'Diego de Almagro',3200),

(3301,'Vallenar',3300),

(3302,'Alto del Carmen',3300),

(3303,'Freirina',3300),

(3304,'Huasco',3300),

(4101,'La Serena',4100),

(4102,'Coquimbo',4100),

(4103,'Andacollo',4100),

(4104,'La Higuera',4100),

(4105,'Paiguano',4100),

(4106,'Vicuña',4100),

(4201,'Illapel',4200),

(4202,'Canela',4200),

(4203,'Los Vilos',4200),

(4204,'Salamanca',4200),

(4301,'Ovalle',4300),

(4302,'Combarbalá',4300),

(4303,'Monte Patria',4300),

(4304,'Punitaqui',4300),

(4305,'Río Hurtado',4300),

(5101,'Valparaíso',5100),

(5102,'Casablanca',5100),

(5103,'Concón',5100),

(5104,'Juan Fernández',5100),

(5105,'Puchuncaví',5100),

(5106,'Quilpué',5100),

(5107,'Quintero',5100),

(5108,'Villa Alemana',5100),

(5109,'Viña del Mar',5100),

(5201,'Isla de Pascua',5200),

(5301,'Los Andes',5300),

(5302,'Calle Larga',5300),

(5303,'Rinconada',5300),

(5304,'San Esteban',5300),

(5401,'La Ligua',5400),

(5402,'Cabildo',5400),

(5403,'Papudo',5400),

(5404,'Petorca',5400),

(5405,'Zapallar',5400),

(5501,'Quillota',5500),

(5502,'Calera',5500),

(5503,'Hijuelas',5500),

(5504,'La Cruz',5500),

(5505,'Limache',5500),

(5506,'Nogales',5500),

(5507,'Olmué',5500),

(5601,'San Antonio',5600),

(5602,'Algarrobo',5600),

(5603,'Cartagena',5600),

(5604,'El Quisco',5600),

(5605,'El Tabo',5600),

(5606,'Santo

...

Descargar como (para miembros actualizados) txt (12 Kb)
Leer 1 página más »
Disponible sólo en Clubensayos.com