Yes, you could do that. The GradeResults table would have fields:
- CourseOfferingId (or CourseId)
- MinScore
- Grade
MinScore would be the minimum score you need to get the grade.
To find the grade for a score of Score, you would make a query something like this:
Code:
SELECT TOP (1) Grade FROM GradeResults
WHERE MinScore <= Score
ORDER BY MinScore DESCENDING
The TOP (1) part selects only the first record returned by the query, which should be the one that applies to the score.
In practice, a program might load these values when it starts so it doesn't need to look in the database every time it needs them. For example, it could make an array with 100 entries and then just use the score as an index into the array. It would waste some memory but would be very fast and the amount of memory would be small.