概念到关系的映射
这是一个家庭作业问题。我已经有了自己的答案,但不确定是否正确,需要你们的建议。这是概念图:
-------------
| Employer |
-------------------
| EmployerID, Name|
-------------------
|
|- supervise
|
------------------ --------------- ---------
| Running Project | ------- |Year, duration| | Project |
------------------- --------------- -----------
| | ProjectID, ProjectName,|
|- works -------------------
|
-------------
| Employees |
-------------
| EmpID, Name|
--------------
这是我的关系模式:
Employer(EmployerID, name) ->主键是 EmployerIDEmployees
(EmpID, name) ->主键是 EmpID
我认为雇主和雇员实体应该是正确的,就像它的正常类别一样。但是我不确定正在运行的项目和项目实体,即关联类和依赖类。这是我的答案:
RUNning Project (EmpID, Year, Duration, ProjectID, ProjectName) ->所有主键
Project(ProjectID, ProjectName) ->所有主键
this is a homework question. I already have my own answer, but I am not sure if its correct, need your guys advise. Here is the conceptual diagram:
-------------
| Employer |
-------------------
| EmployerID, Name|
-------------------
|
|- supervise
|
------------------ --------------- ---------
| Running Project | ------- |Year, duration| | Project |
------------------- --------------- -----------
| | ProjectID, ProjectName,|
|- works -------------------
|
-------------
| Employees |
-------------
| EmpID, Name|
--------------
Here is my relational schema:
Employer(EmployerID, name) -> Primary key is EmployerID
Employees(EmpID, name) -> Primary key is EmpID
I think the employer and employees entity should be correct, as its normal class. BUt I am not sure the Running project and project entity, which is the association class and the dependent class. Here is my answer:
RUnning Project (EmpID, Year, Duration, ProjectID, ProjectName) -> all primary keys
Project(ProjectID, ProjectName) -> all primary keys
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
这是我从关系中了解到的,
在这种情况下,可以识别 3 个根表:雇主、雇员和项目。用于关联根表的表有:
同样,我对 Project 表有一个建议,年份属性似乎是年份 (或日期)项目开始的时间。如果是,则 Duration 属性是派生属性 (CurrentDate - StartDate)。该派生属性不需要包含在表中。
Here is what I understood from the relationship,
In that case, one can identify 3 root tables: Employer, Employee and Project. The tables that are used to relate the root tables are:
Again, I have a suggestion for the Project table, the year attribute seems to the year (or date) when the project was started. If so, then the Duration attribute is a derived attribute (CurrentDate - StartDate). This derived attribute need not be included in the table.