Payments made by Guest in SQL

Question:

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

Code:

Main.sql

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;

Recommended:

Leave a Comment

Your email address will not be published. Required fields are marked *