Building up one to many relation ship data [Resolved]

Posted by Gayathri under Sql Server on 6/26/2012 | Points: 10 | Views : 986 | Status : [Member] | Replies : 7
I am developing an attendance system for an institue.
I have a two tables called Employee and Technology.
Employee has the following structure
Ecode Ename Departmentcode Tcode (Allow null) ----> DepartmentCode Dname
1 Das A01 --- > A01 Admin
2 Peter T03 Dtt T03 Technical
3 anand H02 H02 HR
4 Henry T03 Jav
5 Jessica T03 Oc
6 Ram T03 Ux


Technology
Tcode Technology name
Dtt Dotnet
Jav Java
Oc Oracle
UX Unix

But there are many faculties who can take more than one technology. how do i maintain that..
one idea from my side is designing the employee table with tcode1 tcode2 tcode3 and mapping it to technology.

Is this correct? please advice




Responses

Posted by: .Netlearner on: 6/26/2012 [Member] Starter | Points: 50

Up
0
Down

Resolved
In the new table(EmpTechnology) Either ECode nor TCode will not be unique.

Eg)

ID ECode TCode
1 001 32
2 001 45
3 002 32

While Selecting the Papers the Employee have taken u can join those three tables(Employee,Technology,EmpTechnology) and retrieve data as required


Gayathri, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: .Netlearner on: 6/26/2012 [Member] Starter | Points: 25

Up
0
Down
Your Idea is correct but its not an efficient one.Instead you can have a separate table where u store

ID ECode TCode

and link other two table with this using ECode and TCode.

hope this works

Gayathri, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Gayathri on: 6/26/2012 [Member] Starter | Points: 25

Up
0
Down
you mean to say one employee (repeated value)with multiple skills ( should be unique)

Is that right?


Gayathri, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Sriramnandha on: 6/26/2012 [Member] Starter | Points: 25

Up
0
Down
Hi,

u can create another table.

id Ecode Tcode

1 1 C
2 1 C
3 2 S
4 3 J



Hope this will help

regards


sriram

Gayathri, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Gayathri on: 6/26/2012 [Member] Starter | Points: 25

Up
0
Down
THANKS A TON...............:) I JUST POSTED AND COMPLETED THE TASK IT SELF.

DOTNETFUNDA IS SIMPLY SUPERB...THE BEST FORUM....






Gayathri, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: .Netlearner on: 6/26/2012 [Member] Starter | Points: 25

Up
0
Down
Mark as answer if your Query is completely solved and if my answers are useful it vl be motivating

Gayathri, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Gayathri on: 6/27/2012 [Member] Starter | Points: 25

Up
0
Down
Is it possible to display the data like this.

Ecode skill1 skill2
001 c S
002 c

which means 001 knows both c and S
002 knows only C
and skill1 skill2 are captions of tname
i am not sure if this is possible. please help.

Gayathri, if this helps please login to Mark As Answer. | Alert Moderator

Login to post response