简体   繁体   中英

Booking Calendar Data Presentation

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.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM