I have a set of categories for a MySQL database that wont change much, but might on occasion. (maybe around a dozen choices)
For this sort of situation, where answers are basically multiple choice, should I just use a text field in my main table then in PHP limit the answers, or make a separate table to hold the lookup values then store the id from the category table in the main table?
Just looking for normalization best practices 🙂
Both are OK, they have the following consequences:
I think it depends if they are “data” (-> database) or really part of the application (-> definitely PHP code, e.g. if you have
if ($cat == 'x') { ... }anywhere in your code.)It sounds to me more like they are data so in that case put them in a table.