I've changed some of your names here for clarity. tables got tbl on the front, and Mandatory and Optional got Is or Min in front to show whether they were a yes/no or a count field.
Code:
tblCourses
CourseID (autokey)
CourseName ***Text***
tblEmps
EmpID (autokey)
EmpName ***Text***
RankID (foreign Key to tblRanks)
PromotionID (foreign Key to tblPromotions)
tblCourseLogs
CourseLogID (autokey)
EmpID (foreign Key to tblEmps)
CourseID (foreign Key to tblCourses)
RankID (foreign Key to tblRanks)
tblPromReqs
PromReqID (Autokey)
PromotionID (foreign Key to tblPromotions)
CourseID (foreign Key to tblCourses)
IsMandatory (Yes/No)
tblPromotions
PromotionID (AutoKey)
PromotionName ***Text***
MinMandatory (Number of Mandatory Courses)
MinOptional (Number of Optional Courses)
tblRanks
RankID (Autokey)
RankName ***Text***
Some notes about Issues that I see in the database structure -
1) The ranks don't have any real order. The RankID is an autokey, so the key itself should not imply anything about which rank might be better than which other rank. If the company decides to add another rank, or decides to implement a different ladder, then the database will have to change.
For a real world application, I would suggest that each tblPromotions record should have two ranks associated with it - the old rank that you must be in order to get that promotion, and the new rank that you will be after that promotion. If people could get the same promotion starting from two different ranks, then the structure will need to be modified.
2) tblLogs, obviously, should have a date that the Course was completed.
3) Technically, the minimum number of Mandatory Courses for a promotion is redundant data on tblPromotions, since it can be determined by a simple query against tblPromReqs on PromotionID. Every time someone adds or deletes a mandatory tblPromReqs record, or changes and existing tblPromReqs record from Mandatory to optional or vice versa, that number will change.
4) On the tblEmps record, you have PromotionID. I don't understand what that might be. If this is a record of the last promotion, wouldn't that be implicit in her current Rank? If it's the next one she's trying for, does it really belong on the database, and does it belong on the tblEmps record, or somewhere else?
For recording the prior promotion, I would recommend implementing a tblPromLogs table to track the date of the last promotion of each employee. So, I'd suggest these changes to the above table structure -
Code:
tblCourseLogs
CourseLogID (autokey)
EmpID (foreign Key to tblEmps)
CourseID (foreign Key to tblCourses)
RankID (foreign Key to tblRanks)
LogDate ***Date***
tblPromLogs
PromLogID (autokey)
EmpID (foreign Key to tblEmps)
PromotionID (foreign Key to tblPromotions)
PromDate ***Date***
tblPromotions
PromotionID (AutoKey)
PromotionName ***Text***
OldRankID (foreign Key to tblRanks)
NewRankID (foreign Key to tblRanks)
MinMandatory (Number of Mandatory Courses) {we'll consider deleting this one later}
MinOptional (Number of Optional Courses)
Some questions about your envisioned procedure for promotion -
If the same course is required for promotion from rank 1 to rank 2, and from rank 2 to rank 3, does the course have to be taken a second time?
When a staff member achieves a promotion, do the records that gained them that promotion go away, or are they retained fofr future potential promotions?
Can a staff member be considered for two different promotions at the same time, or does their current rank determine a single promotion that is the only one available?