Thursday, April 23, 2009

Steps In Normalization

 1. Isolate repeating groups from an entity because they are easier to process separate from the rest of an entity. The first four attributes (employee number, name, branch and department) are virtually constant. The remaining three attributes-(item number, item description, and price) contain data that change and are repeated with different salespersons. Therefore, the repeating group should be separated, from the entity "salesperson."

             The salesperson data file with employee number as the primary key and the salesperson item file with employee number and item number as new attributes. They are added to relate the records in the file to the salesperson data file. The two attributes are used together for accessing data. Two keys used together are called a concatenated key.

2. After isolating repeating groups from the rest of an entity, try to simplify the relation further. The second normalization makes sure that each non­ key attribute depends on a key attribute or concatenated key. Nonkey attributes that do not meet this condition are split into simpler entities. In the salesperson item file, the attribute "sales price" depends on a concatenated key ("employee number" and "item number")' The way the file is set up, the sales price is strictly related to the salesperson number and the item number of the sale. Alternatively, the attribute "item description" tags to "item number," which is part of the concatenated key. This causes several concerns. Sales information is availbe only by salesperson number, which is unwieldy. Worse yet, an employee transfer would make it difficult to maintain records because they would be dropped when the salesperson leaves the department.
                 To solve the problem, we create new independent entities for "item description" and "sales price." In one file, we create the item description attribute with item number keys from the salesperson item file. The remaining attributes (employee number, item number, and sales price) become the second normalized form.

The second normalization offers several benefits. Sales items can be added without being tagged to a specific salesperson. If the item changes we need to change only the item file. If a salesperson leaves the department it would have no direct effect on the status of the items sold.

3. Looking at the second normalization, we find further room for improvement. In the salesperson data file, the attribute "store branch" is tagged to the primary key "employee number," while the' attribute "department" is related to "store branch," which is a nonkey attribute. Making "store branch," a key attribute requires isolating "department" along with "store branch.

          With the third normalization, we can have store branch information independent of the salespersons in the branch. We can also make changes in the "department" without having to update the record of the employees in it. In this respect, normalization simplifies relationships and provides logical links between files without losing information.

No comments:

Post a Comment