命名问题 - 非程序性问题

发布于 2024-12-02 15:23:06 字数 256 浏览 0 评论 0原文

我的数据库中有两个表:客户和分包商。

现在看来,有些客户也可以是分包商。

我决定做的是创建一个保存公共数据的基表(超级类型),然后在其他表中完成每种类型(客户、分包商)的相关信息。它会是这样的:

 NEW_TABLE<------Customers
          <------Subcontractors

问题是我真的不知道如何称呼这个表。 “合作伙伴”这个名字是最好的选择吗?

I have two tables in my db: Customers and Subcontractors.

Now it appears that some customers can be also subcontractors.

What I decided to do is to create a base table (super type) that holds the common data and then complete the relevant info for each type (customer, subcontractor) in other table. It will be something like this:

 NEW_TABLE<------Customers
          <------Subcontractors

The problem is that I don't really know what to call this table. Is the name "Partner" the best option?

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

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

发布评论

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

评论(6

仲春光 2024-12-09 15:23:06

同意其他答主的观点。在获得真正有用​​的答案之前,需要有关该域的更多信息。

但我建议使用 ThirdPartyExternalParty,因为我假设 客户分包商 是您企业的外部人员。内部各方可以是 UserInternalParty 等。

我认为您已经正确标记了这个问题。

希望这有帮助。

Agreed with the other responders. More information about the domain is needed before getting really useful answers.

But I'd suggest ThirdParty or ExternalParty, since I'm assuming Customers and Subcontractors are external to your business. Internal parties could be User, InternalParty, etc.

I think you've tagged this question properly.

Hope this helps.

蓝颜夕 2024-12-09 15:23:06

如果不知道域名,没有人可以回答您的问题。
它可以是合作伙伴、联系人、公司。

Nobody can answer your question without knowing the domain.
It can be partner, contact, company.

夜深人未静 2024-12-09 15:23:06

“派对”也许是一个好名字。您可以找到很有趣。或者只是谷歌“数据库党模型”。

'Party' may be a good name. You can find this and this interesting. Or just google "Database Party Model".

如歌彻婉言 2024-12-09 15:23:06

恕我直言,有两个主要选项:

  1. 有一个名为 third_party 的表,其中的 party_type 列为 'customer' 或 '分包商'(以及其他人和时间流逝,如'供应商'等)。
    详细信息主要是所有第三方所共有的联系方式详细信息
  2. 有两个像现在这样的表,但将公共数据存储在单独的表中,例如 contact_details,并具有来自这两个表的外键表到该详细记录。当客户同时也是承包商时,两条记录将指向相同的详细信息记录。

我更喜欢选项 2,因为它允许每种类型存在不同的关系。

IMHO, there are two main options:

  1. Have a single table called third_party that has a party_type column of either 'customer' or 'subcontractor' (and others and time goes by, like 'supplier' etc).
    The details are largely contact details, which are common to all third parties
  2. Have two tables like you have now, but store the common data in a separate table, for example contact_details, and have a foreign key from both tables to that details record. When a customer is also a contractor, both records would point to the same details record.

I prefer option 2, because it allows different relationships to exist for each type.

暗藏城府 2024-12-09 15:23:06

我将其称为 SubcontractorBase,但正如 Peri 指出的那样,在不了解域名的情况下很难说

I'd call it SubcontractorBase, but as Peri points out it is hard to say without knowing the domain

溇涏 2024-12-09 15:23:06

拥有一个表,将所有选项(无论命名如何)都设置为 BOOL,这样您就可以轻松指示一方何时属于多个组(将来您还可以根据需要添加类别)怎么样?

What about having a single table, with all of the options (however named) as BOOLs so that you could easily indicate when a party belongs in more than one group (you'd also be able to add categories as needed in the future)

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