0

In my web application there exists a web form with certain questions on it. Some of these questions will be pulled / retrieved from the database.

Here is some sample data:

sample data

My question is, is there much gain in moving the Type column (determines what sort of HTML input element to display on the form) into its own table and have a foreign key to the question type?

You might argue that instead of the words 'Text, Select ... etc' I'll have numbers .. but they'll still repeat! is there any gain in doing this?

Any clarification would be greatly appreciated.

Thank You.

0

I think they should stay on the same table !
If you have lots of row(questions) you can use this column(type) to partition your table by it as i think you might have 3-4 distinct values(select,text,checkbox) !
This would make your query faster by doing this !
As for the naming of your type column, yes they look better as number and save you some space on you database as Int comparisons are faster than varchar comparisons, for the simple fact that ints take up much less space than varchars.

  • So the only gain is the speed and space, and not a fault in design considerations for normalization .. etc – J86 Mar 7 '14 at 12:16
  • 1
    No, i don't see any design considerations, there will always be a different view of how you can layout your objects, but i always go for less space used(less I/O) and simple designs!! – Up_One Mar 7 '14 at 12:42

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.