I need to make a website for a dating company. And I am realy wondering what would be the best way to design the database. I have a table members. holding details like: name, username, password, email, date of birth, city, and province. Furthermore the detail page of each member should hold certain characteristics like: marital status, sexual orientation, color of the hair, color of the eyes etc… Now I wonder should I have all these characteristics as varchars in the members table or would it be better to have them as foreign keys?
Hi Rudi. ease of development is not an issue for me. I just want the best way to develop this site, so accuracy/consistency of data to facilitate searching etc is very important to me
Absolutely. Especially if you want to have users search on these keys any time in the future.
Searching through a million records for everyone with the eye color that’s smallint 1 is a hell of a lot faster than finding everyone with the eye color Blue, indexed or not. Or worse, finding everyone using a LIKE or searching for BLUE, Blue, and blue.