简体   繁体   中英

sql database design for conference room scheduler

I am working on designing a database for conference room scheduler application. And we have rooms that can be merged to create a bigger one. for example, Room A can be merged to Room B to hold 64 people. I have attached my Database design below I couldn't figure out how to accommodate this feature at the back end. database level. cRoom 数据库设计图

And also, I would like my database to accommodate the rooms information that could be merged. lkRooms table only list single rooms and their capacity. there are rooms that can be merged specifically with one adjacent to them (roomA + room B) and also I have quad rooms ( RoomC + RoomD + RoomE + RoomF). these rooms can be used as a single rooms and can be merged to create one big room. I do I make my database accommodate this? I want the application to get room information from DB. if what I want to say make any sense at all

What I would do is have the booking table reference an intermediate table, let's say bookingRoom , by fk bookingRoomID . The bookingroom record would then reference lkRoom by RoomID . bookingRoom would have multiple records for a given bookingRoomID for a "merged" room. Otherwise, for a single room booking, there would just be a single record in bookingRoom .

I think you need a 'partition' concept that allows rooms to merge, so instead of storing the largest room possible, you store the smallest, and people can reserve a partition to form the larger room whose capacity equals the sum of the smaller rooms. Then you need a roomPartition relationship. So if someone wants to book a merged room, they also book the partition.

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