Reputation: 171
I am quite new to database design and was trying to draw a model for a database where there are several relations with quite as many functional dependencies. My question however is related to the relationship between the following relations: Division, Department and Employees. if each division and each department is headed by an employee, would it be better to create a separate relation with 2 attributes, namely the divisionID(which is the primary key for Division) and EmpID(which is the primary key for Employees) for the relationship between Employees and the Departments and do the same thing for the relationship between Employees and the Divisions? or would it be better to add two new columns in Employees for DivisionHead and DeptHead (which will evidently have plenty of NULL values)?
Upvotes: 0
Views: 72
Reputation: 46
I would assume that the simplest way is the best in this case. If you assume that there is only one head for each dept and also for each division then why not just throw in a foreign key to those tables? Add a head_id attribute to both Division and Dept. It would contain an EmpID of an employee that is a head of a unit.
It's all about assumptions that you make. If you need something more complicated than just one head for one unit then the design might need to be reshaped.
Upvotes: 1