How do I find the problems that the student didn’t do? i.e. the rows problem rows that (for this particular student) doesn’t have a matching row in personproblem.
My (wrong) idea was:
SELECT problem.id, problem.name
FROM problem
LEFT OUTER JOIN personproblem ON personproblem.problem = problem.id
WHERE personproblem.id IS NULL
AND (personproblem.person = " . $studentid . " OR personproblem.person IS NULL)
My problem is that if another student have made this problem, it will not show up.