Modelo Entidad-Relación
Modelo Relacional
Modelo completo descargable:
https://drive.google.com/file/d/0B8ymHXH2z4a0b0lwdEpxZldyUW8
Script con inserción de datos:
https://docs.google.com/file/d/0B8ymHXH2z4a0OVViUENMNmVWUjg
Consultas:
Muestra la cantidad de vuelos correspondientes a cada tramo:
select tramo.id_tramo,count(*) as cantidad_vuelos
from recorre,tramo, vuelo
where tramo.id_tramo = recorre.tramo_id_tramo
and vuelo.id_vuelo = recorre.vuelo_id_vuelo
group by tramo.id_tramo
order by tramo.id_tramo
Muestra los aviones que llegaron a destino antes del 30 de enero del 2012, con su respectivo piloto:
select piloto.nombre as nombre_piloto, avion.id_avion as id_avion,
avion.marca as marca_avion,avion.modelo as modelo_avion
from vuelo,avion,piloto
where TO_DATE(fecha_hora_llegada,'dd/mm/yyyy') < TO_DATE('30/01/12','dd/mm/yyyy')
and vuelo.id_avion = avion.id_avion
and piloto.id_piloto = vuelo.id_piloto
Muestra la cantidad de aeropuertos visitados por cada piloto:
select piloto.id_piloto,count(aeropuerto.nombre) as cantidad_aeropuertos
from tramo,recorre,vuelo,piloto,aeropuerto
where tramo.id_tramo = recorre.tramo_id_tramo
and recorre.vuelo_id_vuelo = vuelo.id_vuelo
and vuelo.id_piloto = piloto.id_piloto
and aeropuerto.id_aeropuerto = tramo.id_aeropuerto
group by piloto.id_piloto
order by piloto.id_piloto

