views:

26

answers:

1

I have a ER-Diagram (Show in http://www.4freeimagehost.com/show.php?i=f82997ca4d5d.png). In the diagram you see 2 entities and a 1:N relataion together. Project has 2 columns as ProjectID, ProjectName. Employee has 3 colums as EmployeeID, EmployeeName and ProjectID. A project has ONLY 1 project-manager and project-manager is a employee. What columns add them?

A: 

Simple solution (EXACTLY ONE manager)

  • Add the ManagerID into the Projects table

More generic solution (allows 0, 1 or more managers)

  • Add a table "ManagesProject" with two columns: ProjectID, EmployeeID.
Konerak
Are you sure for "Simple solution" option?It's very important.
M R Jafari
It depends on your specifications. 'ONLY' one project-manager, is that 'EXACTLY ONE' or 'MAXIMUM ONE (zero allowed)'? The Generic Solution will work in all cases - when in doubt, use it, as it is more extensible.
Konerak