I have this simple database I'm working on as assignment in university: I don't need full solution, I just need the way it work.
1: UsageCount : how many times they used the question in past exams.
2: CorrectAnswerCount : how many student Answered the question right.
3: StudentCount : The number of student took the exam.
My question is:
How do I make a check constraint (between QuestionInExam and Exam) enforcing that CorrectAnswerCount <= StudentCount
?
Also, how do I raise the UsageCount for a question every time it is used in an exam?