How to USE surrogate Key value for history maintenance

Database
Enthusiast

How to USE surrogate Key value for history maintenance

Hi Team,

Can any one give me an example regarding maintentance of history of data through surrogate key.

Scenario:-

suppose there is a user having emp_id e1 name "DRAVID".We are storing employee related information (like name,email etc ..)

in table A.Suppose this user has done some task like he completed 5 courses and we are maintaining this information in table B (Emp_id and courses complted).

After some days emp_id of that employee changed to e2 and again nformation stored in the same table A.

This e2 again completed some courses say 10 and information stored in table B.

As e1 and e2 are same.If we want to see how many courses "DRAVID" has completed till now.It should be 15 .How we will achieve this through surrogate key.

using surrogate key how will we handle this?

Let me know if i am missing something? i need this asap..

Regards,

Abhilash Kumar

Tags (1)