我有一个很大的Excel表格(表格示例请参见图片)。我需要把它转移到一个MySQL数据库。
看起来我最终得到了很多多对多的表。(请参看表格DB结构图)
无论出于什么原因,感觉都不太对劲,有没有更好的方法来构建表的DB结构?
备选结构:
发布于 2018-06-05 03:52:55
我的结构是这样的:
Drugs(id, drug_name, drug_date)
Ingredients(id, ingredient_type_id, ingredient_name, form)
IngredientTypes(id, ingredient_type)
DrugIngredients(id, drug_id, ingredient_id, additional_ingredient_id)
DrugIngredients-药物是多对一,DrugIngredients-配料是多对多(在两个不同的列上),而配料-IngredientTypes是多对一。在Ingredients
中,form
列可以是enumeration type。
https://stackoverflow.com/questions/50685146
复制相似问题