alpinegroove
Registered User.
- Local time
- Today, 10:47
- Joined
- May 4, 2011
- Messages
- 55
I am building a database with information about courses and instructional staff in my school. Each course is comprised of a lecture (taught by Instructor); some courses have discussion sections (taught by a Teaching Assistant) in addition. The same person in some cases teaches both the lecture and discussion sections (and is therefore deemed both Instructor and Teaching Assistant for the course). In other case, there are different people teaching the Lecture and the Discussion; that is, one person is the Instructor and the other person is the Teaching Assistant. People can also serve as Readers.
To address the many-to-many relationship and assign roles, I use a junction table. This is the general structure:
tblPeople
-pkPeopleID primary key, autonumber
-txtFName
-txtLName
-txtAddress
tblRoles
-pkRoleID primary key, autonumber
-txtRole
tblCourses
-pkCourseID primary key, autonumber
-lngCourseTitle
-txtCourseName
tblCoursePeopleRoles
-pkCoursePeopleRoleID primary key, autonumber
-fkCourseID foreign key to tblCourses
-fkPeopleID foreign key to tblPeople
-fkRoleID foreign key to tblRolesWhere would be the best place to put salary information? Each course/role/person combination has its own salary. For example, for a given course, a person is paid x to be the instructor and y to be the reader for that same course. For another course, the same person is only paid to be the instructor. The salary amounts are additionally not uniform. They vary from course to course and are entered manually into the database.
The final goal is to populate contracts. Each instructor gets a separate contract for each course they are associated with. For example, John Smith is the Instructor for Math 1A and also teaches the Discussions in that course. He would get one contract that lists both his Instructor and Teaching Assistant salary for this course.
John Smith also teaches Math 15, where he is only the Instructor. For this course, he would receive a separate contract listing only Instructor salary.
So the main question is where in the db to store salary information given the model above?Should I create a tblSalary and link it to the junction table? That way, each course/instructor/role combination has its own salary.
But if I do that, how do I then prepare the data for the merge?
Thanks!
To address the many-to-many relationship and assign roles, I use a junction table. This is the general structure:
tblPeople
-pkPeopleID primary key, autonumber
-txtFName
-txtLName
-txtAddress
tblRoles
-pkRoleID primary key, autonumber
-txtRole
tblCourses
-pkCourseID primary key, autonumber
-lngCourseTitle
-txtCourseName
tblCoursePeopleRoles
-pkCoursePeopleRoleID primary key, autonumber
-fkCourseID foreign key to tblCourses
-fkPeopleID foreign key to tblPeople
-fkRoleID foreign key to tblRolesWhere would be the best place to put salary information? Each course/role/person combination has its own salary. For example, for a given course, a person is paid x to be the instructor and y to be the reader for that same course. For another course, the same person is only paid to be the instructor. The salary amounts are additionally not uniform. They vary from course to course and are entered manually into the database.
The final goal is to populate contracts. Each instructor gets a separate contract for each course they are associated with. For example, John Smith is the Instructor for Math 1A and also teaches the Discussions in that course. He would get one contract that lists both his Instructor and Teaching Assistant salary for this course.
John Smith also teaches Math 15, where he is only the Instructor. For this course, he would receive a separate contract listing only Instructor salary.
So the main question is where in the db to store salary information given the model above?Should I create a tblSalary and link it to the junction table? That way, each course/instructor/role combination has its own salary.
But if I do that, how do I then prepare the data for the merge?
Thanks!