Link to home
Start Free TrialLog in
Avatar of trueguru
trueguru

asked on

What is the correct database design for a "How did you hear about us?" with a customizable "Other" option?

I have a relational database with a user table in it.

I have a website with a "How did you hear about us?" dropdown list.

The dropdown list is table driven. The table used to populate the dropdown has options like "Station 1", "Station 2", etc. One of the options in the drop down is "Other".

When the user selects "Other" a textbox appears so they can input their custom answer. The user then clicks save and the selected option is stored in the database.

Herein lies the problem. What would the ideal normalized table structure look like for storing the selected option when the selected option is "other" and contains extra data. I can think of several ways to do structure it but none of them seem "clean" to me.

One option would be to add a column to the user table and store the text value there but this isn't normalized.
ASKER CERTIFIED SOLUTION
Avatar of Guy Hengel [angelIII / a3]
Guy Hengel [angelIII / a3]
Flag of Luxembourg image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of trueguru
trueguru

ASKER

Yes I thought about this. Definitely you want the ID from the "WhereDidYouHearAboutUs" table but it doesn't seem correct to store the extra "Other" field data in the user table.

I don't believe that there is a more "elegant" solution so, unless someone else comes up with an alternative, I'm going to accept your solution and continue coding.

Thank you!