Results 1 to 9 of 9
Oct 22, 2012, 19:07 #1
- Join Date
- Oct 2012
- 0 Post(s)
- 0 Thread(s)
Need some help with sql urgently please
hi i have an assignment dude tonight and as usual i have left it to the last minute >< . I am having trouble with the last 3 questions and if u are able to help i would really appreciate it i will donate $10 to a charity or your website
the tables are
For the Sheraton hotel, list (in the ascending order) the total number of bookings for each room type.
SELECT HOTEL_NO, COUNT(*) AS TOTALCOUNT
FROM ROOM, BOOKING
WHERE H.H_NAME = 'SHERATON'
AND B.HOTEL_NO = R.HOTEL_NO
GROUP BY HOTEL_NO;
Find numbers and names of guests who booked rooms (at any hotel) in the price range between 230 and 350 dollars. Show also how many times they booked such rooms.
SELECT GUEST_NO, G_NAME, R_PRICE
FROM GUEST, ROOM
WHERE R_PRICE >230 <350;
(SELECT SUM GUEST_NO FROM BOOKING);
Find the maximum average room price (regardless of room type) of all the hotels (Hint: Find the average of each hotel first).
SELECT HOTEL_NO, AVG(R_PRICE) FROM ROOM
GROUP BY HOTEL_NO