Is it a good idea to put different types of lookup values into the same table

database-design

On a blog I read a proposal to replace many tables like this:

lookup_genders
0 | Unknown
1 | Female
2 | Male

lookup_countries
0 | Unknown
1 | Germany
2 | UK
3 | USA

into a single table like this:

lookups
0 | Unknown | Gender
1 | Female  | Gender
2 | Male    | Gender
4 | Germany | Country
5 | UK      | Country
6 | USA     | Country

The reason provided there was to get rid of many almost identical O/R mappings.

Is this a really good idea? Which problems could arise? Under which conditions would this be a good idea?

Best Answer

The first time you want to add a new property to your countries, you are in trouble. For example, what would be the capital of 'Female' ?

Related Topic