【发布时间】:2010-11-28 00:00:10
【问题描述】:
我有一个包含用户的网站,我希望用户能够识别他们的种族。如果只有 1 级层次结构,最好的建模方法是什么?
方案一(单表):
Ethnicity
- Id
- Parent Id
- Name
方案二(两张表):
Ethnicity Group
- Id
- Name
Ethnicity
- Id
- Ethnicity Group Id
- Name
我将使用它,以便用户可以根据种族搜索其他用户。这两种方法中哪一种更适合我?还有另一种我没有考虑过的方法吗?我正在使用 MySQL。
【问题讨论】:
-
如果只有一层等级怎么会有EthnicityGroup?
标签: mysql database data-modeling database-design