Select random 10 unique rows from MySQL database?
You can do this by using following query.

SELECT * FROM questions WHERE question_id NOT IN (SELECT question_id FROM student_answers WHERE student_id = '5') ORDER BY RAND() LIMIT 10;

I have assumed that there is 3 tables.


question - Hold all questions
student_answers - hold student specific answers of each question.
student - hold student informations.


I expect that student_id is the primary key of student table and foreign key of student_answer table.

The student_is is brought from session or somewhere.