Resort with Least Capacity in SQL

Resort with Least Capacity

Write to query to display the name and town name of the resort that has least bed room count. Sort the output on the resort name.

Resort with Least Capacity in SQL
Resort with Least Capacity in SQL

SQL Code: Resort with Least Capacity Solution

select rs.resortname, rs.townname
from resort rs left join cabin c
    on rs.resortid = c.resortid
    where c.bedroomcount = (select min(bedroomcount) from cabin)
    order by 1;

Related:

Leave a Comment

2 + 1 =