"the report is a set of ratings?" Yes
OK, that clears things a little bit. I'm still unceratin as to what exactly are you trying to model, but I'll give it a stab:
The RATING PK1 ensures no student can rate the same course more than once. A report is simply a set of ratings.
This structure does not ensure that all ratings in the report are related to the same course, nor it enforces the course attendance in any way2.
1 Specifically, the fact that REPORT_ID
is outside the PK, so one rating cannot be part of multiple reports. If you want the opposite, you cannot just include that field in the PK since that would allow for different VALUE
s - you'll need a proper junction table instead.
2 You might want to forbid a rating of a course by a student that did not attend the course. Let me know how you intend to represent the course attendance and I might have some ideas how to connect that to ratings and reports...