关于数据标准化的想法
我正在设计一个用于工作管理的应用程序。可以使用 WBS(工作分解结构)将工作分解为(技术上)无限级别。
在定义每个级别的职位/任务编号时,标准化任务/职位参考数据(即职位编号)的最佳方法是什么?
例如,我有 5 个用于识别任务/工作的参考字段。前三个字段标识第 1 级的作业。第四个字段添加第 2 级作业的标识符。显然,参考字段的数量要么很快就会用完,要么我必须添加大量参考处理不同级别的 WBS 的字段。
有什么建议吗?
顺便说一句,我使用的是 MS-SQL Server,但这个概念应该适用于任何数据库。
谢谢, John
更多详细信息
我正在使用 WBS 级别的父级;但是,每个级别都有一个不同的职位编号,由上一级别的职位编号+该级别职位的标识符组成。
示例:
Level 1 XXXX-99-1234
Level 2 XXXX-99-1234-A
作业编号中的每个部分都是 WBS 表中的特定列。
Table:
(
WBSID INT,
WBSParentID INT,
WBSLevelID INT,
WBSReference1 VARCHAR (XXXX from above)
WBSReference2 VARCHAR (99 from above)
WBSReference3 VARCHAR (1234 from above)
WBSReference4 VARCHAR (A from above)
....
)
显然,我不希望继续添加更多 WBSReferenceX 字段来处理所有可能的 WBSLevel。
将值连接到一个字段中不是一种选择,因为我们必须为每个级别维护不同的标识符。
I'm designing an app for work management. The work can be broken down in (technically) infinite levels using a WBS (Work Breakdown Structure).
When defining the job/task numbers for each level, what is the best way to normalize the task/job reference data (i.e. Job Number)?
For example, I have 5 Reference fields for Identifying tasks/jobs. The first three fields identify the job at level 1. The 4th field adds an identifier for the job at Level 2. Obviously, the number of Reference fields is either going to run out soon or I would have to add an insanely large number of reference fields to handle the different levels of WBS.
Any suggestions?
BTW, I am using MS-SQL Server but the concept should be applicable to any db.
Thanks,
John
more details
I am using a parent child for the WBS level; however, Each level has a distinct Job Number that consists of the job number from the previous level + the identifier for the job at this level.
Example:
Level 1 XXXX-99-1234
Level 2 XXXX-99-1234-A
Where each part in the Job Number is a specific column from the WBS table.
Table:
(
WBSID INT,
WBSParentID INT,
WBSLevelID INT,
WBSReference1 VARCHAR (XXXX from above)
WBSReference2 VARCHAR (99 from above)
WBSReference3 VARCHAR (1234 from above)
WBSReference4 VARCHAR (A from above)
....
)
Obviously, I don't wish to keep adding more WBSReferenceX fields to handle all the possible WBSLevels.
Concatenating the values into one field is not an option as we must maintain the distinct identifiers for each level.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我不确定我是否理解你的问题,但你似乎想 存储树结构在关系数据库中。您可以使用父(或子)列来执行此操作,该列指示当前记录在树中的位置。
I am not sure whether I understand your question, but it seems like you want to store a tree structure in a relational database. You can do this with a parent (or child) column, which indicates the position of the current record in the tree.