select
name customer_name
,total_travel_cost
,order_count
,avg_order_price
from
(
    select
    customer_id
    ,count(*) order_count
    ,sum(price) total_travel_cost
    ,round(avg(price), 2) avg_order_price
    from bookings b
    join packages p on b.package_id = p.id
    where substring(booking_date, 1, 4) = '2024'
    group by 1
) t1
join customers c on t1.customer_id = c.id
where total_travel_cost > 10000
order by 2 desc