Number of Resort under each Manager in SQL

Question:

Number of Resort under each Manager

 Each manager is assigned with a few resorts. Management wants to know how many resorts (rated 4 and above) assigned to each manager. Write a query to display the manager id and number of resort assigned to each of them. Give alias name to number of resort as “NUMBEROFRESORT”. Sort the result set in ascending order of manager id.

Number of Resort under each Manager

Code:

Main.sql

select managerID, count(resortid) as NUMBEROFRESORT 
from resort 
where starRating>=4 
group by managerID 
order by managerID;

Recommended:

Leave a Comment

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

x