Presentation is loading. Please wait.

Presentation is loading. Please wait.

Creating Databases Data normalization. Integrity and Robustness. Work session. Homework: Prepare short presentation on enhancement projects. Continue working.

Similar presentations


Presentation on theme: "Creating Databases Data normalization. Integrity and Robustness. Work session. Homework: Prepare short presentation on enhancement projects. Continue working."— Presentation transcript:

1 Creating Databases Data normalization. Integrity and Robustness. Work session. Homework: Prepare short presentation on enhancement projects. Continue working on implementation.

2 What is normalization? Data analysis is a process that prepares a data model for implementation as a simple, non- redundant, flexible, and adaptable database. The specific technique is called normalization. Normalization is a data analysis technique that organizes data attributes such that they are grouped to form non-redundant, stable, flexible, and adaptive entities.

3 Goals of normalization Have well-defined tables—at most one value for each field. Store each item of information exactly one place so if/when it changes, only have to change one place. Relationships are valid: foreign keys refer to existing primary keys. Don't store items that can be calculated so making changes is simplified.

4 Process of defining database May start with the desired end products (sometimes called artifacts) –Reports –Forms May be from original, possibly even non- automated version of application May be from combination of applications. Goal is to produce single database that serves multiple uses.

5 But… Problems are common. Example: change address [one place] but old information persists. Your experience?

6 Normalization process First step is to do what is necessary to get each entity into 1 st normal form: –An entity is in first normal form (1NF) if there are no attributes that can have more than one value for a single instance of the entity. Any attributes that can have multiple values actually describe a separate entity, possibly an entity and relationship. –Common situation is so-called multiple values, such as distinct items in an order (distinct beneficiaries, game- machines) –Action is to create new entity

7 Modifying model to 1 st NF Many items (titles) Associative entity: Use combination of keys for new (concatenated) key

8 Moving to 2 nd NF If you do not have any concatenated keys, no work is needed. Model is already in 2 nd NF. If you do have any concatenated (combination) keys, you need to examine these entities. –An entity is in second normal form (2NF) if it is already in 1NF and if the values of all nonprimary key attributes are dependent on the full primary key—not just part of it. Any nonkey attributes that are dependent on only part of the primary key should be moved to any entity where that partial key is actually the full key. This may require creating a new entity and relationship on the model.

9 Moving to 2 nd NF Some attributes relate to the product itself, not the fact that the product is part of this order. Remove these attributes.

10 So… In my store example, the ordered items records would NOT have information just relating to the order or just relating to the product.

11 Moving to 3 rd NF Make sure that all non-primary attributes depend just on the key, not, for example, on another attribute. –An entity is in third normal form (3NF) if it is already in 2NF and if the values of its nonprimary key attributes are not dependent on any other non-primary key attributes. Any nonkey attributes that are dependent on other nonkey attributes must be moved or deleted. Again, new entities and relationships may have to be added to the data model. –Typical example is something that can be calculated.

12 Example of move to 3 rd NF

13

14

15 Normalization …. is a process. It is [somewhat] mechanical. There is chance that your model may be in 1 st, 2 nd, or even 3 rd without action or much action on your part, but it is good to go through the process. Note: Some may argue for certain redundancies, for example, storing a calculated value. Why or why not?

16 Normalization decreases chances of needing to change information in more than one place. Happened to you?

17 Homework Prepare short presentation on enhancement project, including Entity- Relationship diagrams (which may not have changed from original) and Data Flow Diagram (which probably did change) Work on enhancement projects.


Download ppt "Creating Databases Data normalization. Integrity and Robustness. Work session. Homework: Prepare short presentation on enhancement projects. Continue working."

Similar presentations


Ads by Google