ER 建模与数据库规范化之间的关系
数据库规范化与 ER 建模有何关系?
先有什么??
还是应该同时实施?
How is database normalization related to ER Modelling??
What comes first??
Or should both be implemented at the same time??
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我认为在高度规范化的数据库设计中,建模应该放在第一位。
创建模型可以让您思考表如何相互关联,还可以让您设想在编写联接查询时需要使用哪些表。
使用 MySQL Workbench 或 Toad Data Modeler 甚至可以生成 SQL 命令来直接从模型构建表、约束和索引,具体取决于您的目标数据库供应商。这很有用,因为它可以确保完全按照您的设计创建表。
此外,在更改模型时,某些工具(例如上面提到的工具)甚至允许您通过发出执行此操作所需的必要语句来“更新”模式。
简而言之,对于具有多个表的项目,我总是首先对其进行建模。它还使开发人员更容易一目了然地了解表的功能和关联,而不必通过阅读 DDL 来理解它。
建模甚至可以很有趣!
使用 MySQL Workbench 创建的模型:
希望这会有所帮助!
I feel modeling should come first in a highly normalized database design.
Creating the model allows you to think through how the tables will relate to one another and also allows you to envision what tables you'll need to use when writing your join queries.
Using a tool such as MySQL Workbench or Toad Data Modeler , depending on your target database vendor, can even generate SQL commands to build the tables, constraints, and indexes directly from the model. This is useful because it ensures the tables are created exactly as you designed them.
Also, when making changes to the model, some tools like those mentioned above will even allow you to "update" your schema by issuing the necessary statements required to do so.
So in short, for a project with more than one table, I'd always model it first. It also makes it easier for developers to understand how the tables function and relate at a glance rather than having to read through DDL to understand it.
Modeling can even be fun!
A model created with MySQL Workbench:
Hope this helps!