[英]How to mange inventory tables for a hotel booking system in mysql database
Hi am working on a hotel booking system. 嗨,我在酒店预订系统上工作。 Where admin can add multiple hotels and multiple rooms for each hotel.
管理员可以在其中添加多个酒店,并为每个酒店添加多个房间。
But right now i am stuck in inventory management. 但是现在我被困在库存管理中。 For every room there will be 3 type of inventories
每个房间都有3种清单
And priority order for inventory selection will be 3 -> 2 -> 1. 选择库存的优先顺序为3-> 2-> 1。
ie. 即。 When user select a date in website and search for hotels.
当用户在网站上选择日期并搜索酒店时。 First check in daily inventory if there is a daily inventory found then and its match for the user requirement then will proceed further.
首先检查每日库存 ,然后找到每日库存,然后再与用户需求进行匹配。
Else if there is no daily inventory then will check for periodic inventory and If periodic inventory not found then will check for master inventory . 否则,如果没有每日库存,则将检查定期库存,如果没有找到定期库存,则将检查主库存 。
For every room there will be a master inventory but periodic and daily inventory are optional. 每个房间都有一个主清单,但定期和每日清单是可选的。 And in master inventory you can give available rooms from Sunday to Saturday ie.
在总库存中,您可以给星期日至星期六的可用房间。 for 7 days in a week.
一周7天。 Same for periodic inventory.
定期库存相同。
Right now i am trying to implement it like this 现在我正在尝试像这样实现它
ID integer
HOTEL_ID integer
ROOM_NAME varchar
INV_SUN integer
INV_MON integer
INV_TUE integer
.
.
INV_SAT integer
PERIODIC_STAR_DATE Date
PERIODIC_END_DATE Date
PERIODIC_SUN integer
PERIODIC_MON integer
.
.
PERIODIC_SAT integer
I don't know the method i following is correct and i have no idea how to mange daily inventory. 我不知道我遵循的方法是正确的,而且我也不知道如何管理每日库存。 As of now it is really difficult to search availability for hotels.
到目前为止,要搜索酒店的空房情况确实很困难。
Please advice me how to redesign the database in a better way. 请给我建议如何以更好的方式重新设计数据库。
Here is your answer: 这是您的答案:
This design states that:
该设计指出:
Now you can make queries eg 现在您可以进行查询,例如
so on and so forth. 等等等等。 You can make numerous queries but this 4 tables are enough to meet your requirements in all respect
您可以进行许多查询,但是这4个表足以满足您的所有要求
Update: 更新:
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.