命名问题 - 非程序性问题
我的数据库中有两个表:客户和分包商。
现在看来,有些客户也可以是分包商。
我决定做的是创建一个保存公共数据的基表(超级类型),然后在其他表中完成每种类型(客户、分包商)的相关信息。它会是这样的:
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 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(6)
同意其他答主的观点。在获得真正有用的答案之前,需要有关该域的更多信息。
但我建议使用
ThirdParty
或ExternalParty
,因为我假设客户
和分包商
是您企业的外部人员。内部各方可以是User
、InternalParty
等。我认为您已经正确标记了这个问题。
希望这有帮助。
Agreed with the other responders. More information about the domain is needed before getting really useful answers.
But I'd suggest
ThirdParty
orExternalParty
, since I'm assumingCustomers
andSubcontractors
are external to your business. Internal parties could beUser
,InternalParty
, etc.I think you've tagged this question properly.
Hope this helps.
如果不知道域名,没有人可以回答您的问题。
它可以是合作伙伴、联系人、公司。
Nobody can answer your question without knowing the domain.
It can be partner, contact, company.
“派对”也许是一个好名字。您可以找到此和这很有趣。或者只是谷歌“数据库党模型”。
'Party' may be a good name. You can find this and this interesting. Or just google "Database Party Model".
恕我直言,有两个主要选项:
third_party
的表,其中的party_type
列为'customer'
或 '分包商
'(以及其他人和时间流逝,如'供应商
'等)。详细信息主要是所有第三方所共有的联系方式详细信息
contact_details
,并具有来自这两个表的外键表到该详细记录。当客户同时也是承包商时,两条记录将指向相同的详细信息记录。我更喜欢选项 2,因为它允许每种类型存在不同的关系。
IMHO, there are two main options:
third_party
that has aparty_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
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.
我将其称为
SubcontractorBase
,但正如 Peri 指出的那样,在不了解域名的情况下很难说I'd call it
SubcontractorBase
, but as Peri points out it is hard to say without knowing the domain拥有一个表,将所有选项(无论命名如何)都设置为 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)