select 
C. name as customer_name, 
sum(P.price) as total_travel_cost, 
count(B.customer_id) as order_count, 
round(sum(P.price)/count(B.customer_id), 2) as avg_order_price
from bookings B

join packages P on P.id = B.package_id
join customers C on C.id = B.customer_id

where year(booking_date) = 2024
group by C. name
having sum(P.price) > 10000
order by sum(P.price) desc