Base SQL Empresa
Enviado por Ninoka • 16 de Julio de 2018 • 1.207 Palabras (5 Páginas) • 382 Visitas
...
Hidalgo’)
insert into delegacion values(20,’Venustiano Carranza’)
insert into delegacion values(30,’Gustavo. A. Madero’)
insert into Area values(1,’Zona Norte’,’excelente empresa’)
insert into Area values(2,’Area Metropolitana’,’Se rigen por la calidad’)
insert into Area values(3,’Zona Poniente’,’Una gran responsabilidad a la hora de trabajar’)
insert into Titulacion values(32,’proyecto’)
insert into Titulacion values(12,’promedio’)
insert into Titulacion values(45,’tesis’)
insert into Asesor values(112,’JOSE HERNANDEZ’,10,10,10,32)
insert into Asesor values(113,’LINO SAUCEDO’,20,20,20,12)
insert into Asesor values(114,’KEVIN ESCALONA’,30,30,30,45)
insert into pais values(100,’Argentina’,42192494 ,14714018,’Buenos Aires’)
insert into pais values(200,’Austria’, 8576261, 1081190 ,’Viena’)
insert into pais values(300,’Canada’,35492000,51958038, ’Ottawa’)
insert into Sede values(221,’La paz’)
insert into Sede values(222,’NewStoe’)
insert into Sede values(223,’toronto’)
insert into Paem values(100,1,221)
insert into Paem values(200,2,222)
insert into Paem values(300,3,223)
insert into asempre values(112,1,1,10/05/05)
insert into asempre values(113,2,2,31/12/04)
insert into asempre values(114,3,3,10/11/09)
insert into vendedor values(12,’Luis’,15,1,10,12,10,20)
insert into vendedor values(13,’Ernesto’,16,2,20,13,30,30)
insert into vendedor values(14,’Fernando’,17,3,30,14,20,10)
/*CONSULTAS*/
SELECT *
FROM Area
SELECT *
FROM Asesor
SELECT *
FROM Empresa
SELECT *
FROM vendedor
SELECT *
FROM delegacion
SELECT *
FROM colonia
SELECT *
FROM calle
SELECT *
FROM titulacion
SELECT *
FROM sede
SELECT *
FROM pais
SELECT *
FROM paem
SELECT *
FROM asempre
/*EMPRESA,SEDE,PAIS*/
SELECT id_emp,nom_emp,num_vend,nom_pais
FROM Empresa inner join Paem on Empresa.id_emp=paem.id_emp1
inner join pais on pais.id_pais=paem.id_pais1
inner join sede on sede.id_sede=paem.id_sede1
/*EMPRESA,PAIS*/
SELECT id_emp,nom_emp,num_vend,nom_pais,Capital,pib,num_hab
FROM Empresa inner join paem on empresa.id_emp=paem.id_emp1
inner join pais on pais.id_pais=paem.id_pais1
/*SEDE,PAIS*/
SELECT id_sede,nom_pais,ciudad,capital
FROM sede inner join paem on sede.id_sede=paem.id_sede1
inner join pais on pais.id_pais=paem.id_pais1
/*EMPRESA,SEDE*/
select id_emp,nom_emp,fact_anual,id_sede,ciudad
FROM empresa inner join paem on empresa.id_emp=paem.id_emp1
inner join sede on sede.id_sede=paem.id_sede1
/*vendedor y vendedor*/
select cod_vend,cod_vend,num_vend
from vendedor inner join vendedor on vendedor.cod_vend=vendedor.cod_vend1
/*DIRECCION VENDEDOR*/
select cod_vend,nom_vend,nom_calle,nom_dele,nom_colo
from vendedor inner join calle on calle.id_calle=vendedor.id_calle1
inner join Delegacion on delegacion.id_dele=vendedor.id_dele1
inner join Colonia on colonia.id_colo=vendedor.id_colo1
/*DIRECCION ASESOR*/
select id_asesor,nom_asesor,nom_calle,nom_dele,nom_colo
from asesor inner join calle on calle.id_calle=asesor.id_calle2
inner join Delegacion on delegacion.id_dele=asesor.id_dele2
inner join Colonia on colonia.id_colo=asesor.id_colo2
/*TITULACION ASESOR*/
select id_asesor,nom_asesor,tipo_tit
from asesor inner join titulacion on titulacion.num_tit=asesor.num_tit1
/*EMPRESA, AREA,ASESOR*/
select id_Asesor,nom_asesor,fecha_in,nom_emp,fact_anual,nom_area
from
...