I am working on a quiz module where I want to show the user the wrong answered questions from his quiz result. The result of quiz is stored in one table t1_result
with columns user_id, question_id, option_id
and the correct answers for quiz questions are stored in another table t2_answers
with question_id and correct_answer_id
. Now I want to match the two result sets and find unmatched question and answer combinations.
I have looked around and tried few queries but no luck till now. Looking for some insights over this.
t1_result
+----+------+---------------------+
| user_id | question_id| option_id|
+----------+------------+----------+
| 11 | 41 | 213 |
+----------+-----------+----------+
| 11 | 42 | 222 |
+----------+-----------+----------+
| 11 | 43 | 295 |
+----------+-----------+----------+
| 11 | 44 | 265 |
+----------+-----------+----------+
| 11 | 45 | 145 |
+----------+-----------+----------+
t2_answers
+----+------+---------------------+
| question_id | correct_answer_id|
+----+---------+------------------+
| 41 | 11 |
+----+---------+------------------+
| 42 | 14 |
+----+---------+------------------+
| 43 | 15 |
+----+---------+------------------+
| 44 | 265 |
+----+---------+------------------+
| 45 | 145 |
+----+---------+------------------+