Presentation is loading. Please wait.

Presentation is loading. Please wait.

Gegevens Analyse Les 4: Normaliseren. Functional Dependency Rules If A  (B, C), then A  B and A  C If (A,B)  C, then neither A nor B determines C.

Similar presentations


Presentation on theme: "Gegevens Analyse Les 4: Normaliseren. Functional Dependency Rules If A  (B, C), then A  B and A  C If (A,B)  C, then neither A nor B determines C."— Presentation transcript:

1 Gegevens Analyse Les 4: Normaliseren

2 Functional Dependency Rules If A  (B, C), then A  B and A  C If (A,B)  C, then neither A nor B determines C by itself

3 Normal Forms 1NF – A table that qualifies as a relation is in 1NF 2NF – A relation is in 2NF if all of its nonkey attributes are dependent on all of the primary key [FW] of attribuut is afhankelijk van ander niet-sleutel-attribuut. 3NF – A relation is in 3NF if it is in 2NF and has no determinants except the primary key Boyce-Codd Normal Form (BCNF) – A relation is in BCNF if every determinant is a candidate key “I swear to construct my tables so that all nonkey columns are dependent on the key, the whole key and nothing but the key, so help me Codd.”

4 Multivaled Dependencies A multivaled dependency occurs when a determinant determines a particular set of values: Employee  Degree Employee  Sibling PartKit  Part The determinant of a multivaled dependency can never be a primary key

5 Multivaled Dependencies

6 Eliminating Anomolies from Multivaled Dependencies Multivalued dependencies are not a problem if they are in a separate relation, so: –Always put multivaled dependencies into their own relation –This is known as Fourth Normal Form (4NF)

7 De 5e, 6e, 7e….enz NF? Snel overslaan en gaan naar DKNF

8 Normalization: Advantages and Disadvantages

9 Choosing Not to Use BCNF BCNF is used to control anomalies from functional dependencies There are times when BCNF is not desirable The classic example is ZIP codes: –ZIP codes almost never change –Any anomalies are likely to be caught by normal business practices –Not having to use SQL to join data in two tables will speed up application processing

10 Multivaled Dependencies Anomalies from multivalued dependencies are very problematic Always place the columns of a multivalued dependency into a separate table (4NF)

11 Denormalization For read-only databases, normalization is seldom an advantage –Application processing speed is more important Denormalization is the joining of data in normalized tables prior to storing the data The data is then stored in non-normalized tables

12 Normalized Tables

13 Denormalizing the Data INSERT INTO PAYMENT_DATA SELECT STUDENT.SID, Name, CLUB.Club, Cost, AmtPaid FROM STUDENT, PAYMENT, CLUB WHERESTUDENT.SID = PAYMENT.SID ANDPAYMENT.Club = CLUB.Club;

14 Na analyse komt synthese Uitgangspunt is dat er juist maar 1 attribuut in een tabel staat en dat we dan gaan kijken welke attributen er nog meer bij mogen In plaats van splitsen wordt het nu plakken! Maar wel op basis van regels.


Download ppt "Gegevens Analyse Les 4: Normaliseren. Functional Dependency Rules If A  (B, C), then A  B and A  C If (A,B)  C, then neither A nor B determines C."

Similar presentations


Ads by Google