Payments made by Guest in SQL

Payments made by Guest

Write a query to display the booking and the payment made by 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 guestid.

Payments made by Guest in SQL
Payments made by Guest in SQL

SQL Code: Payments made by Guest Solution

select g.name, r.resortname, b.fromdate, b.todate, b.adultcount, b.childcount, b.totalcharge
from guest g join booking b
           on g.guestid=b.guestid
           join resort r
           on b.resortid= r.resortid
order by g.guestid;

Related:

Leave a Comment

two × 3 =