I am developing a booking calendar and I want to represent the availability of cabins by time slots as below.
And display a combined "availability" view of all the cabins as below:
What would be the best table structure in order to represent this requirement. and how can I query the database to get my final overall availability screen? Can i get the intended output in one query?
Or any proposals to represent the overall availability of cabins in a better way than above is most welcome.
Your suggestions are much appreciated.
A simple structure might be as follows:
cabins
(cabin_id*
,cabin_name)
bookings
(booking_id*
,cabin_id
,from_datetime
,to_datetime)
* = (component of) PRIMARY KEY
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.