mysql - How to structure/normalize this database? -
i need make database should hold 50 questions, 3 possible answers each question , value of each answer.
this first guess feels wrong , i'm not sure how access values properly. suggestions on how structure this?
this seems correct way:
questions table --------------- id title ... answers table ------------- id question_id answer value
one way be
questions table --------------- id title ... values table ------------ id value answers table ------------- id question_id answer value_id
then answers of specific question do
select a.*, v.value answers join questions q on q.id = a.question_id join values v on v.id = a.value_id q.title = 'what name of dr. who'
Comments
Post a Comment