rewritten sql because airline_id etc. is now not optional