Aug 13, 2020 3:11 pm
Write a query to display the booking and the payment made by the guest. Display guest name, resort name, from date, to date, adult count, child count, and total charges made by guest. Sort the output in the ascending order of the guest.
2 Replies
Aug 23, 2020 8:28 am
You can try this query
Select a.bookingID, a.totalcharge, b.name as GuestName, c.ResortName, a.todate,a.fromdate,a.adultCount, a.childCount, a.totalcharge from Booking a, Guest b, Resort c Where a.guestid=b.guestID AND b.resortID=c.resortID Order by b.guestid asc
Jun 01, 2021 2:40 pm
Query to display the booking and the payment made by the guest. Display guest name, resort name, from date, to date, adult count, child count, and total charges made by guest. Sort the output in the ascending order of the guest.
Select guest.name, resort.resortname, booking.fromdate, booking.todate, booking.adultcount, booking.childcount, booking.totalcharge from guest join booking on guest.guestid=booking.guestid join resort on booking.resortid= resort.resortid order by guest.guestid;