Добавил:
Upload Опубликованный материал нарушает ваши авторские права? Сообщите нам.
Вуз: Предмет: Файл:
Скачиваний:
75
Добавлен:
22.03.2015
Размер:
468.74 Кб
Скачать

6

ERwin Methods Guide

 

 

ERwin Support for Normalization

ERwin provides some support for normalization of data models, but does not currently contain a full normalization algorithm. If you have not used a “real time” modeling tool before, you will find ERwin’s standard modeling features quite helpful. They will prevent you from making many normalization errors in the first place.

First Normal Form Support

In a model, each entity or attribute is identified by its “name.” ERwin will accept any name for an object, with the following exceptions:

ERwin will flag a second use of an entity name (depending on your preference for unique names).

ERwin will flag a second use of an attribute name, unless that name is a rolename. When rolenames are assigned, the same name for an attribute may be used in different entities.

ERwin will not let you bring a foreign key into an entity more than once without giving it a rolename each time.

By preventing multiple uses of the same name, ERwin is basically leading you to put each fact in exactly one place. There may still be second normal form errors if you place an attribute incorrectly, but no algorithm would find that without more information than is present in a model.

In the data model, ERwin cannot know that a name you assign to an attribute can represent a “list” of things. For example, ERwin was happy to accept “children's-names” as an attribute name in our earlier example. So it does not directly guarantee that every model is in first normal form.

However, the DBMS schema function of ERwin does not support a data type of “list.” Because the schema is a representation of the database in a physical relational system, first normal form errors are also prevented at this level.

88 Normalization

ERwin Methods Guide

6

 

 

Second and Third Normal Form Support

ERwin does not currently know about functional dependencies, but it can help to prevent second and third normal form errors. For example, if you reconstruct the examples presented earlier in this chapter, you will find that once “spouse-address” has been defined as an attribute of SPOUSE, you cannot also define it as an attribute of CHILD. (Again, depending on your preference for unique names.)

By preventing the multiple occurrence of foreign keys without rolenames, ERwin is reminding you to think about what the structure represents. If the same foreign key occurs twice in the same entity, there is a business question to ask:

Are we recording the keys of two separate instances, or do both of the keys represent the same instance?

When the foreign keys represent different instances, separate rolenames are needed. If the two foreign keys represent the same instance, then there is very likely a normalization error somewhere. A foreign key appearing twice in an entity, without rolenames, is a dead giveaway that there is a redundant relationship structure in the model. When two foreign keys are assigned the same rolename, unification occurs.

Normalization 89

6

ERwin Methods Guide

 

 

90 Normalization

Соседние файлы в папке Базы данных