Answer the question
In order to leave comments, you need to log in
What is the best way to store the history of the questions marked in the test for each user?
There is a table with questions, in which there are about 10 thousand records. There is a table of users, which is about 2 thousand. I would like not to show the user the questions that he has already passed. Accordingly, I need to store information about this somewhere, but I don’t understand where.
If you make a table with answers, you will get about 20,000,000 records for current conditions. And if there are 10 times more questions or users? This is already 200 million lines. Somehow a lot. And how to search for questions that he has not yet passed? where in not (id1, id2, ..) - unlikely.
Who can faced similar? I can't think of anything.
Answer the question
In order to leave comments, you need to log in
You need to make another table and store data about users and questions in it.
Only 2 int fields - user_id and question_id
Even 200 million such records, provided there are indexes, will not create a significant load on the system.
somehow you think strangely, in the table you will store only the numbers of the questions that he passed, that is, the number of average questions passed, if we say users go through one hundred questions, it will be only 200,000 records
, and even 20 million today is not at all a lot
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question