views:

19

answers:

1

Is there any benefit to storing Days of weeks, Months, Week number, user age, etc as Lookups vs plain text entry into the database? I am creating a social website with some analytic and planning to use a Question table, Answer table and Question_Answer table to store all the data like Gender, Birth months, Age, etc so I can give each an ID to use throughout the system but some older projects I worked on people always stored these are normal text entry only. So I am seeing which design is better to go with to store all the system and user fixed list data which may or may not be used later for reporting using various metrics. If using lookus then how deep to go, do i need to create days of weeks, days of year, weeks of month, etc if I want to create a report like: Comparing number of photos shared on the first of every month for a given set of users vs last day or every month for the same users?

A: 

Given that you are using MySQL, I suggest populating a date helper table, as suggested in the top-rated answer to this question: http://stackoverflow.com/questions/1877874/how-to-fill-date-gaps-in-mysql

The question itself should explain why you would want this table.

Mark Bannister