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 Reactions
1,549 Views
Posts: 17
Topic starter
(@rahul)
Active Member
Joined: 6 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
Posts: 134
Admin
(@sql-admin)
Reputable Member
Joined: 6 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: