建立酒店方案数据库,需要数据库设计意见

发布于 2024-10-22 18:46:08 字数 497 浏览 5 评论 0原文

每个预订都包含客人的姓名和姓名。公司名称。

现在,客人可能/可能不属于公司。 (预订中的公司可能为空)

目前,我有:

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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

猫腻 2024-10-29 18:46:08

这基本上很好,但我会考虑将公司添加到客人中,并且也许从预订表中删除该公司。类似的:

Booking_table (booking_id, guest_id)

Guest_table (guest_id, guest_name, company_id)

除此之外,我认为您的数据库丢失了很多重要数据 - 日期、客户信息等,但这是一个完全取决于您想要通过数据库和软件实现的目标的另一个问题。

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:

Booking_table (booking_id, guest_id)

Guest_table (guest_id, guest_name, company_id)

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.

淡水深流 2024-10-29 18:46:08

似乎拥有预订日期会很有用,并且预订需求可能需要链接到房间表。
这完全取决于您想要保留和跟踪哪些数据;)

除此之外,如果这是家庭作业,请将其标记为家庭作业。

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.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文