[英]manager / employee database design
How would you modify the manager/employee relationship (as seen here ) if managers have an additional attribute that normal employees lack? 你将如何修改经理/员工关系(如看到这里 )如果管理者有一个额外的属性,正常的员工缺乏?
For example, if managers are assigned a parking spot (which itself would be a reference to a parking spot table). 例如,如果为管理人员分配了停车位(其本身就是对停车位表的引用)。
Sounds like the solution would be a "assigned_to" column in the parking lot table. 听起来解决方案将是停车场表中的“ assigned_to”列。 Your database doesn't need to know who has the right to "own" a parking lot in my opinion.
我认为您的数据库不需要知道谁有权“拥有”停车场。
As altenrnative: create a table with parking lot and employee as columns, if more than one employee(or manager) can share a parking_lot. 另外,如果一个以上的雇员(或经理)可以共享一个parking_lot,则创建一个以停车场和雇员为列的表。
One sidenote: it looks as if you are designing your database for the actual situation - that might change in the future; 一个旁注:看起来好像您是在为实际情况设计数据库-将来可能会改变; you cannot know if normal employees won't get a parking lot in the future!
您不知道普通员工将来是否不会获得停车场!
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.