Take the 2-minute tour ×
Database Administrators Stack Exchange is a question and answer site for database professionals who wish to improve their database skills and learn from others in the community. It's 100% free, no registration required.

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.

share|improve this question

1 Answer 1

up vote 0 down vote accepted

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.

share|improve this answer
    
So the only gain is the speed and space, and not a fault in design considerations for normalization .. etc –  Ciwan Mar 7 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 at 12:42

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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