Select
count(*) as total_seats,
count(bp.seat_no) as occupied_seats
from flights f
join seats s
on f.aircraft_code = s.aircraft_code
left join boarding_passes bp
on s.seat_no = bp.seat_no and bp.flight_id = f.flight_id
where f.flight_id = '30625'
;
select * from query_cost('Select
count(*) as total_seats,
count(bp.seat_no) as occupied_seats
from flights f
join seats s
on f.aircraft_code = s.aircraft_code
left join boarding_passes bp
on s.seat_no = bp.seat_no and bp.flight_id = f.flight_id
where f.flight_id = ''30625''');