I am designing MySQL DB for a vocabulary exam.
Table: users, words, results
The participant selects all the words that he/she know its meaning. All exams are different from each other, i.e. an exam is produced randomly from the database. It's about 350 words for every exam.
Now I want to store a result for every exam plus all the words that participant is selected. As you see it is a lot of ids (words) for every exam to save! There are two ways in my mind:
1- ManyToMany Relation in result_word table (max 350 rows for every exam):
result_id | word_id
--------------------
1 | 33
1 | 12
. | .
. | .
2- As a String in a column answered_ids in results table:
id | answered_ids
-------------------------
1 | "12,33,..."
all ids for result 1: answered_ids : "33,12,..."
And then when I need them, explode() them with php!
I think the second way is better because the first way could become thousands of rows in DB very quickly. Am I right? Or is there a better way?
UPDATE:
In this exam, user can see a list of English words randomly selected from words table and nothing else! The user clicks on every word he thinks he knows its meaning! Also, There is a fake_words table that is 50 words randomly is selected in addition to actual words if the user clicks on fake words more than 3 times, the test will fail. The final result will tell the user how much vocabulary skill he has.
I am creating this app with VueJs2. I want to store all the words that user is selected in addition to his exam result. Then when one user wants to see his results, he can see every single word he clicked!
My concern is the following: Would it be a problem if the number of exams becomes a lot? 5000 for example. Also, any general suggestion for how to implement this app would be appreciated.