0% found this document useful (0 votes)
8 views15 pages

Higher Normalization NC Lgu

Uploaded by

abdullahzahidhp
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
8 views15 pages

Higher Normalization NC Lgu

Uploaded by

abdullahzahidhp
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 15

Database System

FURTHER NORMALIZATION II:


HIGHER NORMAL FORMS
2
Topics in this Chapter

 Multi-Valued Dependencies and Fourth Normal Form


 Join Dependencies and Fifth Normal Form
 The Normalization Procedure Summarized
 A Note on Denormalization
 Orthogonal Design
 Other Normal Forms

Lahore Garrison University


3
Rules for 4th Normal Form

 For a table to satisfy the Fourth Normal Form, it should satisfy the following
two conditions:
 It should be in the Boyce-Codd Normal Form.
 And, the table should not have any Multi-valued Dependency.
 Let's try to understand what multi-valued dependency is in the next
section.

Lahore Garrison University


4
What is Multi-valued Dependency

 A table is said to have multi-valued dependency, if the following


conditions are true,
 For a dependency A → B, if for a single value of A, multiple value of B
exists, then the table may have multi-valued dependency.
 Also, a table should have at-least 3 columns for it to have a multi-valued
dependency.
 And, for a relation R(A,B,C), if there is a multi-valued dependency
between, A and B, then B and C should be independent of each other.
 If all these conditions are true for any relation(table), it is said to have multi-
valued dependency.

Lahore Garrison University


5
Example

 Below we have a college enrolment table with columns s_id, course and hobby.

Lahore Garrison University


6
Example

 As you can see in the table above, student with s_id 1 has opted for two
courses, Science and Maths, and has two hobbies, Cricket and Hockey.
 You must be thinking what problem this can lead to, right?
 Well the two records for student with s_id 1, will give rise to two more
records, as shown below, because for one student, two hobbies exists,
hence along with both the courses, these hobbies should be specified.

Lahore Garrison University


7
Example

 And, in the table above, there is no relationship between the


columns course and hobby. They are independent of each other.
 So there is multi-value dependency, which leads to un-necessary
repetition of data and other anomalies as well.

Lahore Garrison University


8
How to satisfy 4th Normal Form

 To make the above relation satisfy the 4th normal form, we


can decompose the table into 2 tables.
 Now this relation satisfies the fourth normal form.
 A table can also have functional dependency along with
multi-valued dependency. In that case, the functionally
dependent columns are moved in a separate table and the
multi-valued dependent columns are moved to separate
tables.

Lahore Garrison University


9
Fifth Normal Form / Projected Normal
Form (5NF)

 A relation R is in 5NF if and only if every join dependency in R is implied by


the candidate keys of R. A relation decomposed into two relations must
have loss-less join Property, which ensures that no spurious or extra tuples
are generated, when relations are reunited through a natural join.
 Properties – A relation R is in 5NF if and only if it satisfies following
conditions:
 R should be already in 4NF.
 It cannot be further non loss decomposed (join dependency)

Lahore Garrison University


10
Example

 Consider the above


schema, with a case as “if
a company makes a
product and an agent is
an agent for that
company, then he always
sells that product for the
company”. Under these
circumstances, the ACP
table is shown as:

Lahore Garrison University


11
Example

 The relation ACP is again decompose into 3 relations. Now, the natural
Join of all the three relations will be shown as:

Lahore Garrison University


12
Example

 Result of Natural Join of R1 and R3 over


‘Company’ and then Natural Join of R13
and R2 over ‘Agent’and ‘Product’ will be
table ACP.
 Hence, in this example, all the
redundancies are eliminated, and the
decomposition of ACP is a lossless join
decomposition. Therefore, the relation is
in 5NF as it does not violate the property
of lossless join.

Lahore Garrison University


13-
13
The Normalization Procedure Summarized

 Begin with a relvar in 1NF


 Take projections to eliminate FDs that are not irreducible; result is in 2NF
 Take projections to eliminate transitive FDs; result is in 3NF
 Take projections to eliminate FDs in which the determinant is not a
candidate key; result is BCNF
 Continue on next slide

Lahore Garrison University


13-
14
The Normalization Procedure Continued

 Using a relation in BCNF, take projections to eliminate MVDs that are not
also FDs
 In practice it is unlikely that you will need to do this, because you will have
eliminated independent relation valued attributes before you began
 Take projections of 4NF relation to eliminate JDs that are not implied by the
candidate keys, if you can find any

Lahore Garrison University


13-
15
Other Normal Forms

 Additional normal forms arise in the analysis of dependency theory


 Domain-key normal form (DK/NF) is not defined in terms of FDs, MVDs, or
JDs
 A relvar R is in DK/NF if and only if every constraint on R is a logical
consequence of the domain constraints and key constraints that apply to
R

Lahore Garrison University

You might also like