Which design better when use foreign key instead of a string to store a list of id
- by Kien Thanh
I'm building online examination system. I have designed to table, Question and GeneralExam. The table GeneralExam contains info about the exam like name, description, duration,...
Now I would like to design table GeneralQuestion, it will contain the ids of questions belongs to a general exam.
Currently, I have two ideas to design GeneralQuestion table:
It will have two columns: general_exam_id, question_id.
It will have two columns: general_exam_id,
list_question_ids (string/text).
I would like to know which designing is better, or pros and cons of each designing.
I'm using Postgresql database.