This query is not that you need i think you want all students attempted to solve specific problem.so check this please