RienSQL
TASK #72 · Medium

Average booking price

Your brief
Print the average booking price per day for each of the rooms that have been booked at least once. The average is the simple mean of the price field over all reservations of the room. It must be rounded up to an integer value.
Expected columnsroom_id avg_priceAirbnb
SQL editor
SQLite
Ctrl / ⌘ + ↵
Result

Write a query and run it to see the results.

Schema
usersid, name, email, email_verified_at, password, phone_number
reservationsid, user_id, room_id, start_date, end_date, price, total
roomsid, home_type, address, has_tv, has_internet, has_kitchen, has_air_con, price, owner_id, latitude, longitude
reviewsid, reservation_id, rating