数据库架构问题

发布于 2024-10-18 20:00:21 字数 210 浏览 0 评论 0原文

我需要在下面创建的数据库设计模式中提供一些建议......我不确定它是否正确......就关系而言。特别是用户 - USER_RESERVATION - 预订。 我想说的是,一个用户可以有多个预订,但是同一个预订可以属于许多不同的用户......我是否正确地表示了它?

在此处输入图像描述

I need some suggestions in the database design schema I've created below... I am not sure that it's correct.. in terms of relationship. Especially the USER - USER_RESERVATION - RESERVATION.
What I am trying to say is that a USER can have many RESERVATION, but then the same RESERVATION can belong to many different USERS... am I representing it correctly?

enter image description here

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

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

发布评论

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

评论(1

尸血腥色 2024-10-25 20:00:21

如果一个用户可以有多个预留,并且每个预留可以针对多个用户,则使用 USER_RESERVATION 表来执行多对多映射是正确的。

不过,在我看来,一个预订属于多个用户似乎很奇怪。我倾向于认为每个用户在系统中都有一个单独的预订,并且会有一些链接预订的概念。因此,如果一个四口之家想要乘坐航班,妈妈、爸爸和每个孩子都需要单独预订一张单独的机票,但所有四个预订都将在系统中链接在一起,以进行某些操作,例如办理登机手续。不过,单独预订,如果妈妈需要将航班推迟一天,或者由于航班被取消,一家人需要重新预订两个不同的航班,那么往往会简化重新预订任务。

If a user can have many reservations and each reservation can be for many users, you are correct to have a USER_RESERVATION table to do the many-to-many mapping.

Off the top of my head, though, it seems odd that a reservation would belong to multiple users. I would tend to think that each user would have a separate reservation in the system and that there would be some concept of linked reservations. So if a family of four wants to take a flight, Mom, Dad, and each kid would have a separate reservation with a separate ticket but all four reservations would be linked together in the system for certain operations like checking in. Separate reservations, though, would tend to simplify rebooking tasks if, say, Mom needed to move her flight back a day or if the family needed to be rebooked on two separate flights because their flight was cancelled.

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