Imagine you have a website with several drop-down lists that populate from a database. The goal is to store these values ββin a database and retrieve them when rendering the form.
I saw two approaches:
1) One table for list type:
profession_type |id|value| hobby_type |id|value|
2) One table for all search values:
|id|type |value| |0 |profession_type|value| |1 |profession_type|value| |2 |profession_type|value| |3 |hobby_type |value| |4 |hobby_type |value| |5 |hobby_type |value|
Are there any objective advantages for any of them? # 2 seems more general (you choose from a table by type to populate a specific drop-down list), but the table will be significantly larger than if you used # 1. In addition, if you use # 2, all foreign keys point to the same same giant table. This doesn't seem like a big deal, but in my eyes this approach seems more confusing.
source share