Msaada: Sequence & Unique number generator

Software Engineer

JF-Expert Member
Dec 20, 2014
344
137
Tunatengeneza software kwaajili ya kampuni ku manage wafanyakazi wake
1. Mfumo wa namba ya mfanyakazi e.g. 100 50 000120
> 100 (1st three digits) zinasimama kama branch ya kampuni alipo mfanyakazi
> 50 ni namba ya department alipo mfanyakazi
> 00120 (120 ndiyo namba halisi ya mfanyakazi)

Database table design iko hivi
> Branch (ID,Name,Code,CompanyID) e.g. (100,Makete,100,2)
> Department(ID,Name,Code,BranchID) e.g. (500,HR,10050,100)
> Employee(ID,Name,Code,DepartmentID) e.g. (120,Samuel,10050000120,500)

Constraints
> Branch hazitazidi 100 hivyo DDD mask inatosha
> Department hazitazidi 10 hivyo DD mask inatosha
> Employee hawatazidi laki moja

Swali:
Tutumie approach gani nzuri ku generate hizo ID za aina tatu? BrachID,DeptID,EmployeeID?

Tumefanya nini hadi sasa?
Tumetumia MS SQL sequence number feature ku generate hizi number lakini tunaona kama siyo the best solution.
 
Back
Top Bottom