create view RepairDetails (AirplaneId, RegistrationNumber,AirplaneModelId, AirplaneModel, Manufacturer, MaintenanceId, MaintenanceDate,
    RepairId, Description, RepairPrice, PartOnAirplaneId, PartType,PartPrice, InUse) as
    select airplane.id, airplane.registrationnumber, airplanemodel.id,
           airplanemodel.model,
           airplanemodel.manufacturer, maintenance.id, maintenance.date,
           repair.id,repair.description,
           repair.price, partonairplane.id, parttype.name,
           parttype.price,partonairplane.inuse
    from maintenance
    join repair on repair.maintenanceid = maintenance.id
    join airplane on maintenance.airplaneid = airplane.id
    join airplanemodel on airplane.modelid = airplanemodel.id
    join partonairplane on repair.partonairplaneid = partonairplane.id
    join parttype on partonairplane.parttypeid = parttype.id;


