I haven't worked too much using foreign keys, so I am doing some reading on implementing that. My only question is won't it be harder for me when I am looking at the populated data in the users_adventures table because I don't see a code next to the user, I would only see a q_id#? A user can have multiple codes, meaning that they have multiple "adventures" open at the same time. They can start a "DTCAP" adventure, and answer 10 questions, quit the session, and return another time and open a "CNROW" adventure, quit that session, and start another adventure and so on. I hope that makes sense how I am wording that.
adventure_questions
q_id q_code q_number question
1 DTCAP 1 DTCAP question 1
2 DTCAP 2 DTCAP question 2
26 CNROW 1 CNROW question 1
27 CNROW 2 CNROW question 2
51 MONFW 1 MONFW question 1
52 MONFW 2 MONFW question 2
users_adventures (Your version) - How can I tell which is DTCAP adventure, which is CNROW, MONFW,etc, without having to look at the other table???
ua_id ua_username q_id ua_score
1 kjb31ca 1 0
2 kjb31ca 27 10
3 kjb31ca 51 0
users_adventures (My old version)
ua_id ua_username ua_code ua_question ua_score
1 kjb31ca DTCAP 1 0
2 kjb31ca CNROW 2 10
3 kjb31ca MONFW 1 0
users_adventures (Suggested version)
ua_id ua_username ua_code q_id ua_score
1 kjb31ca DTCAP 1 0
2 kjb31ca CNROW 27 10
3 kjb31ca MONFW 51 0
Can I keep the ua_code in the users_adventures or is that just redundant and bad practice of implementing a database?