Guest’s Check-In & Check-Out Details in SQL

Question:

Guest’s Check-In & Check-Out Details

Write a query to display the guest name, country, email id , phone number , check in date  , check out date  and total amount to be paid. Sort the output in the ascending order of guest id.

Guest's Check-In & Check-Out Details

Code:

Main.sql

select g.name, g.country, g.email, g.phone, b.fromdate, b.todate, b .totalcharge
from guest g join booking b
on g.guestID=b.guestID
order by g.guestID;

Recommended:

Leave a Comment

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