我为一个大学数据库设计了一个关系模型,如下所示。现在我被要求为这个数据库做一个ER图。我只想知道,是否有任何工具可以从关系模式生成ER图。如果不是,从关系模型生成ER图的步骤是什么?

发布于 2017-04-21 20:14:41
我不知道有任何工具可以从关系模型生成正确的ER图。这些工具的一个困难是,并非所有关系模型都可以解释为ER模型。虽然关系模型可以表达任何有限的事实集(因为它等价于一阶逻辑),但实体关系模型是比较有限的。
要将关系模型转换为ER图,我建议执行以下步骤:
The Entity-Relationship Model - Toward a Unified View of Data。- For example, in `teacher`, `T_ID` and `dept_name` are entity keys, while `name` and `password` represent value sets.
- For example, in `teacher`, the pair `(T_ID, dept_name)` represents a relationship between the entity sets identified by `T_ID` and `dept_name`. We can call those entity sets `teacher` and `department`, but don't confuse them with the tables that have the same names. Another example is `advisor (T_ID, S_ID)`.
- For example, in `teacher`, `T_ID -> name` is an attribute, and `T_ID -> password` is another.
这只是一个基本的起点--这个过程实际上更复杂,因为我们需要寻找弱键、弱实体集、标识关系、关联实体集、总参与或部分参与以及关系基数。
再一次,我强烈建议你仔细研究陈的论文。
PS。我相信section的主键(以及teaches和takes中相应的外键)是不正确的。我怀疑主键应该仅仅是sec_id,但是由于我不确定您的模型实际代表了什么(除了我自己对表和列名的解释之外),所以我不能确定。
https://stackoverflow.com/questions/43537743
复制相似问题