I'm trying to get my head around sub queries and I'm certain I don't actually know what I'm doing. I've got some code that pulls up the hotel names and room price, but the prices are showing the absolute total room price for all hotels together, not each hotel seperately.
SELECT hotelName, SUM(roomPrice) AS 'Room Price'
FROM hotel, room
GROUP BY hotelName
SELECT H.hotelName, SUM(R.roomPrice) as 'Room Price' FROM hotel H JOIN room R ON H.hotelNo = R.hotelNo GROUP BY H.hotelNo;