0% found this document useful (0 votes)
85 views16 pages

Transitive Dependency in 3NF Explained

The document discusses database normalization, focusing on the First, Second, and Third Normal Forms. It outlines the requirements for each form, including the elimination of repeating groups, partial dependencies, and transitive dependencies. The document also provides steps to convert relations into the appropriate normal forms.

Uploaded by

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

Transitive Dependency in 3NF Explained

The document discusses database normalization, focusing on the First, Second, and Third Normal Forms. It outlines the requirements for each form, including the elimination of repeating groups, partial dependencies, and transitive dependencies. The document also provides steps to convert relations into the appropriate normal forms.

Uploaded by

aslamaslamkhan53
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd

Normalization (Cont.

)
Lecture - Objectives
 First Normal Form
 Partial Dependency
 Second Normal Form
 Transitive Dependency
 Third Normal Form

2
First Normal Form
 A relation that has a primary key
and in which there are no
repeating groups.
 No multivalued attributes
 A primary key has been defined

 All relations are in 1st Normal Form

3
Table with multivalued attributes, not in 1st normal form

Note: this is NOT a relation

4
Table with no multivalued attributes and unique rows, in 1st
normal form

Note: this is relation, but not a well-structured one

5
Partial Functional
Dependency
A functional dependency in which one or
more nonkey attributes are functionally
dependent on part (but not all) of the
primary key.

6
Second Normal Form
 1NF PLUS every non-key
attribute is fully functionally
dependent on the ENTIRE
primary key

 Every non-key attribute must be


defined by the entire key, not by only
part of the key
 No partial functional dependencies

7
Functional dependency diagram for INVOICE

Order_ID  Order_Date, Customer_ID, Customer_Name, Customer_Address


Customer_ID  Customer_Name, Customer_Address
Product_ID  Product_Description, Product_Finish, Unit_Price
Order_ID, Product_ID  Order_Quantity

Therefore, NOT in 2nd Normal Form


8
To convert a relation with partial
dependencies to second normal form, the
following steps are required:
1. Create a new relation for each primary key

attribute (or combination of attributes)


that
is a determinant in a partial dependency.
That attribute is the primary key in the new
relation.
2. Move the nonkey attributes that are only
dependent on this primary key attribute
(or 9
Figure 5-28 Removing partial dependencies

Getting it into
Second Normal
Form
Partial dependencies are removed, but there
are still transitive dependencies
10
Transitive Dependency
 A functional dependency between the
primary key and one or more nonkey
attributes that are dependent on the primary
key via another nonkey attribute.
 For example, there are two transitive
dependencies in the CUSTOMER ORDER
relation.
OrderID → CustomerID → CustomerName
OrderID → CustomerID →
11
Transitive dependencies in CUSTOMER
ORDER relation

12
Third Normal Form
 2NF PLUS no transitive
dependencies (functional
dependencies on non-primary-key
attributes)

 Solution: Non-key determinant with


transitive dependencies go into a
new table; non-key determinant
becomes primary key in the new
table and stays as foreign key in the
old table
13
REMOVING TRANSITIVE DEPENDENCIES
Three-step procedure:
1. For each nonkey attribute (or set of
attributes)
that is a determinant in a relation, create a
new
relation. That attribute (or set of attributes)
becomes the primary key of the new relation.
2. Move all of the attributes that are functionally
dependent only on the primary key of the
new
relation from the old to the new relation.
3. Leave the attribute that serves as a primary
key
in the new relation in the old relation to serve
14
Figure: Removing transitive
dependencies

Getting it into
Third Normal
Form

Transitive dependencies are removed

15
Thanks

16

You might also like