Display Guests stayed with Pets in SQL


Display Guests stayed with Pets

 The resort manager wants to know the guest who brought their children and pet to the resort. Write a query to display the guest id, the resort id, the number of days they stayed (give alias name as numberofdays), count of adults, children and pet, their total charge incurred. Display the output in the descending order of pet count.

Quiz for Exam - Display Guests stayed with Pets



 select guestid, resortid,(todate-fromdate) as numberofdays, adultcount, childcount, petcount, totalcharge 
 from booking 
 where petcount>0 and childcount>0 
 order by petcount desc;


Leave a Comment

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