Hi all,
I was wondering if I may bounce a couple ideas off ya'll, I have a project that I am going to implement shortly but before I continue I wanted to know if there would be a more effecate method of storing a retrieving data.
The basic thought is:
I need to be able to provide a question answer interface that will have the following functions:
1. The user has the abilities to create their own questions; hence they will also define what kind of answer that question has.
2. The answers need to be stored in a method that will provide a fairly easy method of data retrieval.
I have come up with a couple options unfortunately they both have down sides.
1 creates a generic table that has data columns for every possible answer. Example col1_int, col2_int, col1_bit col2_bit...
The table has a reference to the question id in the question table.
Option 2:
Store the answer result in an xlm string in an answers table with again a reference to the question table via question id.
The downfall the option 1 obviously is flexibility I can't possible know every possible answer type. Not to method decision tree answers (answer that have additional question based on that answer (example: what kind of animals do you own? dog, cat bird. if dog and cat were selected there would be a series of questions that would posted per animal)
The downfall to option 2 is how to retrieve the stored xml string then retrieve it in a relational fashion (so it makes since to a BI tool.)
Sorry for the long post. But I just wanted to see if anyone has experience with this type of data model.
Any thoughts
Thanks
Talenx
I was wondering if I may bounce a couple ideas off ya'll, I have a project that I am going to implement shortly but before I continue I wanted to know if there would be a more effecate method of storing a retrieving data.
The basic thought is:
I need to be able to provide a question answer interface that will have the following functions:
1. The user has the abilities to create their own questions; hence they will also define what kind of answer that question has.
2. The answers need to be stored in a method that will provide a fairly easy method of data retrieval.
I have come up with a couple options unfortunately they both have down sides.
1 creates a generic table that has data columns for every possible answer. Example col1_int, col2_int, col1_bit col2_bit...
The table has a reference to the question id in the question table.
Option 2:
Store the answer result in an xlm string in an answers table with again a reference to the question table via question id.
The downfall the option 1 obviously is flexibility I can't possible know every possible answer type. Not to method decision tree answers (answer that have additional question based on that answer (example: what kind of animals do you own? dog, cat bird. if dog and cat were selected there would be a series of questions that would posted per animal)
The downfall to option 2 is how to retrieve the stored xml string then retrieve it in a relational fashion (so it makes since to a BI tool.)
Sorry for the long post. But I just wanted to see if anyone has experience with this type of data model.
Any thoughts
Thanks
Talenx