Groups | Blog | Home
all groups > sql server (alternate) > november 2004 >

sql server (alternate) : relationships as a table


Erland Sommarskog
11/30/2004 8:21:15 AM
Vinodh Kumar P (vinodh@here.com) writes:
[quoted text, click to view]

As long as an employee only works on one single project it is. Or a project
never can be staffed by more than one employee.

But in real life an employee works on more than project, and project have
several members. Then you have a many-to-many relation, and the typical
way to sort that out is to introduce a linking table.

--
Erland Sommarskog, SQL Server MVP, esquel@sommarskog.se

Books Online for SQL Server SP3 at
Vinodh Kumar P
11/30/2004 1:05:53 PM
I have the tables tblEmployees and tblProjects.
tblProjects has one column called Percentagetime, to hold the percentage of
time by an employee for a project.

My Question : Why should we introduce a 3rd table called
tblProjectsAndEmployees?
tblProjectsAndEmployees will have
1)EmployeeNumber(PrimaryKey in tblEmployees)
2)ProjectNumber(Primary key in tblProjects)
3)PercentageTime

Having only the tblEmployees and tblProjects is not sufficient?


Kind Regards,
Vinodh Kumar P


AddThis Social Bookmark Button