I am tasked with designing a dating site in asp.net with VB using sql server 2005 as the database platform. I have not had a lot of advanced database design experience so I am hoping someone can help me out with this one....
For each user there is a profile (some profile questions might be: nationality, education, age, eye color, etc, etc..). Each of these profile questions could either contain a single value from a radio button (example: are you male or female), multiple values from a list of checkboxes (example: check your hobbies and interests) or text (ex: tell in a short paragraph what you are looking for).
Does anyone have any advice as to the best way to design this. Here are some of the options I am considering:
1) Create a different table for each profile question:
example:
EyeColor
--------
UserId (int or guid)
EyeColor (varchar)
Interests
---------
UserId
InterestValue
I see this as being a problem because there could be upwards of 50 table joins for each search query and the database would need to be updated if a profile question is added or no longer used.
2) Put the entire profile in one table:
example:
Profile
-------
UserId (int or guid)
HairColor (varchar)
EyeColor (varchar)
LikesMovies (bit)
LikesHiking (bit)
I see this a being a problem as this table could contain up to 70 columns and I think serially searching through this one gigantic table could be very slow if the user base gets large. Also as with the above scenario, the DB would need to be changed to accomidate any additions/deletions to the profile questions.
3) Ideally I would like to design a flexible structure to allow questions of different types (radio, check box, text box) to be added/deleted from an admin interface without having to modify the db structure but I don't know how to design this so it would be efficient for searches.
Another dilema is that I would like to avoid using dynamic SQL, but I dont know how I could search accross a varied number of parameters with a stored procedure.
Could anyone give me some advice on any of the above.
Any advice would be appreciated. Thanks.