zan
zan

Reputation: 21

Need for a look up table?

I have a people table and for each person I need to record category i.e. trainer, trainees, customer.

Should I create a look up table for the above categories, or is it ok to put them as fileds in the people table? The db will be quite simple, so I think nulls are not a problem.

Upvotes: 0

Views: 61

Answers (2)

johnny
johnny

Reputation: 19725

If you only have a few people and you are sure you will never ever add more and never enhance anything then just do it like you want above and do self joins.

If you want to make sure on standardized input for category, for example, you can hard code it or use the lookup table.

You know your data better than I do so you will know what is right. Trust your instincts.

Upvotes: 0

Adithya Surampudi
Adithya Surampudi

Reputation: 4454

Its highly recommended you have another table for category and make it a foreign key. This ensures that all the entries are in one of these categories, and if new categories comeup in future, you can easily append them to the category table

Upvotes: 1

Related Questions