建立酒店方案数据库,需要数据库设计意见
每个预订都包含客人的姓名和姓名。公司名称。
现在,客人可能/可能不属于公司。 (预订中的公司可能为空)
目前,我有:
Booking_table (booking_id, guest_id, company_id)
Guest_table (guest_id, guest_name)
Company_table (company_id, company_name)
Guest_booking_history (guest_id, booking_id)
Company_booking_history (company_id, booking_id)
我这样做对吗?在设计数据库方面有什么建议吗?
另一种选择是:
Booking_table (booking_id, guest_names, company_id)
Company_table (company_id, company_name)
Each reservation contains names of the guests & a company name.
Now, the guests may/may not belong in a company. (a booking may have a company as null)
Currently, I have:
Booking_table (booking_id, guest_id, company_id)
Guest_table (guest_id, guest_name)
Company_table (company_id, company_name)
Guest_booking_history (guest_id, booking_id)
Company_booking_history (company_id, booking_id)
Am I doing this right? Any suggestions in designing the database?
An alternative would be:
Booking_table (booking_id, guest_names, company_id)
Company_table (company_id, company_name)
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
这基本上很好,但我会考虑将公司添加到客人中,并且也许从预订表中删除该公司。类似的:
除此之外,我认为您的数据库丢失了很多重要数据 - 日期、客户信息等,但这是一个完全取决于您想要通过数据库和软件实现的目标的另一个问题。
It's mostly good, but I'd consider adding the company to the guest, and maybe remove the company from the booking table. Something like:
Other than that, I think your database is missing a lot of important data - dates, customer info, etc, but that's a whole other issue fully dependent on exactly what you want to achieve with the database and software.
似乎拥有预订日期会很有用,并且预订需求可能需要链接到房间表。
这完全取决于您想要保留和跟踪哪些数据;)
除此之外,如果这是家庭作业,请将其标记为家庭作业。
Seems like it would be usefull to have the booking dates, and booking needs likely needs to be linked to a table of rooms.
It all depends on what data you want to keep and track ;)
Other then that, if this is homework mark it as that.