# SQL Tables questions

**URL:** <https://forum.kirupa.com/t/sql-tables-questions/318745>\
**Category:** programming\
**Created:** [January 28, 2011, 9:44pm UTC](https://forum.kirupa.com/t/sql-tables-questions/318745 "2011-01-28T21:44:47Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![dreamerp](https://avatars.discourse-cdn.com/v4/letter/d/fbc32d/32.png) [@dreamerp](https://forum.kirupa.com/u/dreamerp)\
**Post date:** [January 28, 2011, 9:44pm UTC](https://forum.kirupa.com/t/sql-tables-questions/318745/1 "2011-01-28T21:44:47Z")

</div>

Hey,

I was wondering the best approach to organizing my MyQL tables.

I have a Questions table that contains a primary question\_id and a question field which is a varchar to store the question.

Then, I have an Answers table that has a primary answer\_id, a question\_id to connect it to a question, and then an answer varchar for the answer.

What I am wondering, is it safe to simply use a boolean field to say whether the answer is correct or not? Or, is this somehow unsecure where a person could potentially EASILY access the answers.

Another solution I was thinking was to have, in the Questions table, a correct\_answer field that would contain an encrypted value. This encrypted value would be either the answer or answer\_id of the correct answer. Every time a person answers, then it would encrypt their answer and check it by comparing it to the encrypted value in the database.

This way, the only way a person could guess the answer was if they knew my encryption.

Does this make sense? Let me know if I explained it okay, and I would appreciate any insight!

Thanks
