Forum

Write a query to di...
 
Notifications
Clear all

Write a query to display the Cabin ID, Cabin Type, Cabin Description and The Number or Bedroom


Rahul Updhyay
Posts: 17
Topic starter
(@rahul)
Active Member
Joined: 11 months ago

Write a query to display the cabin id, cabin type, cabin description, number or bedroom, sleep capacity, and its cost. O/p should be sorted on cabin id.

 
1 Reply
SQL Admin
Posts: 6
Admin
(@sql-admin)
Member
Joined: 10 months ago

Hi Rahul,

Please try this one.

Query: 

Write a query to display the cabin id , cabin type, cabin description , number of bedroom, sleep capacity , and its cost. Output should be sorted on cabin id.

select cbn.cabinid, cbn.cabintype, cbn.describe, cbn.bedroomcount,
cbn.sleepcapacity, (select rate from cabincost where
cabinid=cbn.cabinid) as rate
from cabin cbn
order by 1;
Reply
Share: