TASK #147 · HardExpand reservation date ranges
Your brief
For the room with room_id = 1, use the Reservations table to find every date covered by at least one reservation. Treat each reservation period as inclusive: from start_date through end_date. If a date appears in several reservations, include it in the result only once. Output the dates as separate rows in the day column and sort them in ascending order.
For example, a reservation from 2018-10-09 to 2018-10-11 should add three dates to the result: 2018-10-09, 2018-10-10, and 2018-10-11.
For example, a reservation from 2018-10-09 to 2018-10-11 should add three dates to the result: 2018-10-09, 2018-10-10, and 2018-10-11.
Ctrl / ⌘ + ↵
Result
Write a query and run it to see the results.
Schema
usersid, name, email, email_verified_at, password, phone_numberreservationsid, user_id, room_id, start_date, end_date, price, totalroomsid, home_type, address, has_tv, has_internet, has_kitchen, has_air_con, price, owner_id, latitude, longitudereviewsid, reservation_id, rating