Resortwise count of Bedrooms in each Resort in SQL

Question:

Resortwise count of Bedrooms in each Resort

Write a query to calculate and display the resort id , total count of bed rooms each resort . The result set should be in the ascending order of resort id . Give alias name to count of bed rooms as TOTALCOUNT. 

Resortwise count of Bedrooms in each Resort

Code:

Main.sql

select distinct resortid , sum(bedroomcount) as TOTALCOUNT  
from Cabin
group by resortid
order by resortid;

Recommended:

Leave a Comment

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

x