Maximum amount paid by Guest
Managements wants to know guest and maximum amount paid by each guest for any of the bookings.
Write a query to display the Guest ID, Guest name and maximum amount paid by them(give alias name as MAX_AMOUNT). Sort the result based on guest ID.

SQL Code: Maximum amount paid by Guest Solution
select g.guestid, g.name, max(b.totalcharge) as MAX_AMOUNT
from guest g join booking b
on b.guestid=g.guestid
group by g.guestid, g.name
order by 1;
Related:
- Review Comments Shared by Guest in SQL
- pointofinterest locations in each Town in SQL
- Payments made by Guest in SQL
- Fetch Resort Details in SQL
- Review Comment for all Resort in SQL
- Review Comment for star rating Resort in SQL
- Resort that charges the highest in SQL
- Cities having Summer Temperature More than Jaipur in SQL
- PointOfInterest Locations in Chennai in SQL
- Resort with Least Capacity in SQL
- Guest who paid highest charges in SQL
- Guest details and Total Charges paid in SQL
- Create View_BMS in SQL