Can you find the first and last names of all people who paid more than the rooms' base prices?
select t1.firstname, t1.lastname from reservations as t1 join rooms as t2 on t1.room = t2.roomid where t1.rate - t2.baseprice > 0
The reservation rate, please
select t1.firstname, t1.lastname, t1.rate from reservations as t1 join rooms as t2 on t1.room = t2.roomid where t1.rate - t2.baseprice > 0
Can you find the first and last names of all people who paid less than the rooms' base prices?
select t1.firstname, t1.lastname from reservations as t1 join rooms as t2 on t1.room = t2.roomid where t1.rate - t2.baseprice < 0
Could you add in the reservation rates they paid to the table?
select t1.firstname, t1.lastname, t1.rate from reservations as t1 join rooms as t2 on t1.room = t2.roomid where t1.rate - t2.baseprice < 0
What is the name of the room that was booked most often?
select room from reservations group by room order by count ( * ) desc limit 1