最近在做数据库设计,拿到一本ms press 的 《Designing Relational Database Systems》E文,看了几遍关系数据库设计过程一节,还是没记得住,决定仔细译一下。版权问题,扼要的译。
Defining Relationships
After you've been through all your source documents, you'll have a draft description of the entities and attributes in the problem space. Two tasks remain: establishing the relationships between these entities, and reviewing each entity's attributes and constraints.
在当你过了一遍所有你的源文档后,你就会对问题域里实体及其属性有一个大概的了解。还有两项工作:在实体间建立他们之间的关系和检查实体的每一个属性和属性的约束。
Although theoretically you could review the attributes first, I find it easiest to start with the relationships, since some of these will become additional entities and some will require that attributes be added to entities you've already identified.
虽然理论上你应该先复查实体的属性先,但我发现从它他的关系入手将简单的多,它们之中的一些将被提取出来成新的实体而有一些则需要添加新的属性。
If you're like me, what you have after your first pass through the source documents is a bunch of handwritten notes with arrows and scribbles and "see page 12"s that nobody else could possibly decipher. So the first step in defining relationships is to get these organized neatly. You can start by building the first draft of the Entity Relationship (E/R) diagram of your data model. (If your notes are really messy and you're worried that even you might not be able to read them in three weeks, you might also list the attributes you've identified for each entity.)
如果你和我一样,你将在过了一遍所有的源文档后便用一些符号和手写注释起草,写一些诸如“请看第12页”这些无人知晓的东东。所以定义“关系”的第一步应该先把所有的东东齐整的组织一下。你可以根据你的数据模型的ER图来开始建立先张草图。(如果你的注释着实零乱,而且你害怕三个星期后你可能会忘记,你也可以把每一实体的属性列出来。)
Start by choosing an entity, usually one of the core entities in the system, and then add the entities that have some relationship with it. You can define the nature of the relationships (one-to-one, one-to-many, many-to-