Presentation is loading. Please wait.

Presentation is loading. Please wait.

Jump to first page Normalization Jump to first page Topics n Why normalization is needed n What causes anomalies n What the 4 normal forms are n How.

Similar presentations


Presentation on theme: "Jump to first page Normalization Jump to first page Topics n Why normalization is needed n What causes anomalies n What the 4 normal forms are n How."— Presentation transcript:

1

2 Jump to first page Normalization

3 Jump to first page Topics n Why normalization is needed n What causes anomalies n What the 4 normal forms are n How to normalize a relation to 3NF n Beyond 3NF - BCNF

4 Jump to first page Why Normalization This is a Non-Normal form since it is NOT a Relation: Multi-valued attributes or “repeating groups”

5 Jump to first page Why Normalization n Anomalies u Insertion Anomaly u Deletion Anomaly u Update Anomaly To analyze design To identify problems To correct anomalies Normalization allows us to start with a table and produce a new collection of tables that represent the same information but is free of problems.

6 Jump to first page What Causes Anomalies n Existence of functional dependencies u Key: a set of one or more attributes in a relation that identifies uniquely ALL the other attributes in the relation u Functional Dependency : a set of one or more attributes in a relation that identifies uniquely SOME of the other attributes in the relation u Transitive Dependency: a special kind of functional dependency. A --> B --> C

7 Jump to first page The 4 Normal Forms n 1NF (First Normal Form) u No repeating columns n 2NF (Second Normal Form) u 1NF + No sub-key => non-key n 3NF (Third Normal Form) u 2NF + No non-key => non-key n BCNF (Forth Normal Form) u 3NF + No non-key => sub-key

8 Jump to first page Converting a Relation to 3NF - An Algorithm n Determine the key to relation T n Determine the FDs in relation T n For every FD whose LHS is not a key in relation T, obtain 2 relations T1 and T2 so that T1 contains all attributes of the FD, T2 contains all the attributes of T except the RHS attributes of the FD n If the FD is transitive (A-->B-->C), always decompose B-->C first

9 Jump to first page Converting To 3NF - An Example n Key to the relation u Student_ID, Course_ID n FDs in the relation u STUDENT_ID ---> STUDENT_NAME, MAJOR u COURSE_ID ---> COURSE_TITLE, INSTRUCTOR_NAME -->OFFICE u STUDENT_ID + COURSE_ID ---> GRADE

10 Jump to first page Converting To 3NF - An Example

11 Jump to first page Converting To 3NF - An Example

12 Jump to first page Converting To 3NF - An Example

13 Jump to first page Boyce-Codd BCNF n Every determinant is a key (3NF + no non-key -->subkey) n A student can have 1 or more majors n A student has 1 advisor per major n A major can have 1 or more advisors n An advisor advises 1 major n An advisor can advise 1 or more students in the major


Download ppt "Jump to first page Normalization Jump to first page Topics n Why normalization is needed n What causes anomalies n What the 4 normal forms are n How."

Similar presentations


Ads by Google