I am working on a database design and see myself with lots of *_type tables (e.g. user_type, product_type, etc.) where the structure of these tables is the same, basically:
user_type (
id int pk
label char
)
I could simplify this by doing something like:
labels (
id int pk
label char
context blah
)
but is this an appropriate way to do this?
Best Answer
Please don't combine the various
_type
tables. Your future self (and anyone that ends up writing queries against the tables) will thank you.I would much rather write something like
than
_type
tables together, the database will tend to have much less information to work with so it will be much less likely to pick the most efficient plans.Beyond that, I completely second @BillThor's suggestions for how to create the various lookup tables.