Quote:
Originally Posted by jeshurun
But then the table wouldn't be in third normal form as grade becomes a transitional dependency on student in the score table.
|
No. The problem is you're attempting to model time-dependent table.
Student does
not determine grade, because over time, a student can be in multiple grades. At the very least, you need a separate table to hold valid student-grade combinations. At its simplest, this table will simply record a student and a grade, but if you take into account students skipping or repeating grades, this table will look something like:
student, school year -> grade
Similarly, a student can take a test multiple times. Presumably, a student can also take multiple tests. So your determinant for a test score is:
student, test, date -> score
This leaves you with three options, depending on your requirements:
- Simply record the date a test is taken. You can then do a time-based join to determine what tests where taken in which grade.
- Take the key of the student-grade association table as part of the key in your score table. This will enforce that a test can only be taken while a student is in some grade.
- Do both. This will allow a student to take the same test multiple times while in one grade.