Forum

Write a query to di...
 
Share:
Notifications
Clear all

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

2 Posts
2 Users
0 Likes
807 Views
Rahul Updhyay
Posts: 17
Topic starter
(@rahul)
Active Member
Joined: 2 years 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: 8
Admin
(@sql-admin)
Active Member
Joined: 2 years 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

Leave a reply

Author Name

Author Email

Title *

 
Preview 0 Revisions Saved
Share: