0% found this document useful (0 votes)
9 views12 pages

DB Week 2 Lecture 2

This document discusses functional dependencies and database normalization. It defines functional dependencies as relationships between attributes, usually between a primary key and other attributes. Normalization is described as a process to organize data by removing duplication and anomalies like insertion, update, and deletion anomalies. The purposes of normalization are given as eliminating redundant data and anomalies. Types of anomalies are defined as insertion, update, and deletion anomalies.

Uploaded by

Asif Uddin
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)
9 views12 pages

DB Week 2 Lecture 2

This document discusses functional dependencies and database normalization. It defines functional dependencies as relationships between attributes, usually between a primary key and other attributes. Normalization is described as a process to organize data by removing duplication and anomalies like insertion, update, and deletion anomalies. The purposes of normalization are given as eliminating redundant data and anomalies. Types of anomalies are defined as insertion, update, and deletion anomalies.

Uploaded by

Asif Uddin
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
You are on page 1/ 12

Functional Dependencies and

Normalization

Conducted by
Hasan Muhammad Kafi
Lecturer, Dept. of CSE
Bangladesh Army University of Science and Technology (BAUST)
Functional Dependency
• A functional dependency (FD) is a relationship between two attributes,
typically between the PK and other non-key attributes within a table.

• For any relation R, attribute Y is functionally dependent on attribute


X (usually the PK), if for every valid instance of X, that value of X
uniquely determines the value of Y. This relationship is indicated by
the representation below:
XY

• The left side of the above FD diagram is called the determinant, and
the right side is the dependent.
Examples
• Example 1: SIN determines Name, Address and Birthdate. Given SIN,
we can determine any of the other attributes within the table.
SIN  Name, Address, Birthdate

• Example 2: SIN and Course determine the date completed


(DateCompleted). This must also work for a composite PK.
SIN, Course  DateCompleted

• Example 3: ISBN determines Title.


ISBN  Title
Trivial Functional Dependency
• The dependency of an attribute on a set of attributes is known
as trivial functional dependency if the set of attributes includes
that attribute.

 Symbolically: AB is trivial functional dependency if B is a subset of


A.

 The following dependencies are also trivial: AA & BB


Example
• For example: Consider a table with two columns Student_id
and Student_Name.

{Student_Id, Student_Name}  Student_Id

 Student_Id is a subset of {Student_Id, Student_Name}. 

 Also
Student_Id  Student_Id
Student_Name  Student_Name
Non-Trivial Functional Dependency
• If a functional dependency XY holds true where Y is not a subset of
X then this dependency is called non trivial Functional dependency.

 For example: An employee table with three attributes: emp_id,


emp_name, emp_address.

 The following functional dependencies are non-trivial:

emp_id  emp_name
emp_id  emp_address
Normalization
• Database Normalization is a technique of organizing the data in
the database.

• Normalization is a systematic approach of decomposing tables


to eliminate data redundancy(repetition) and undesirable
characteristics like Insertion, Update and Deletion Anomalies.

• It is a multi-step process that puts data into tabular form,


removing duplicated data from the relation tables.
Purposes of Normalization

• Normalization is used for mainly two purposes:

 Eliminating redundant (useless) data.


 Eliminating Insertion, Update and Deletion Anomalies.
Anomalies in Database

• There are three types of anomalies that occur when the database
is not normalized:

 Insertion anomaly.
 Update anomaly.
 Deletion anomaly.
Insertion Anomaly
• There are facts we cannot record until we know information for
the entire row.

 Example: we cannot record a new sales office until we also know the
sales person.
Update Anomaly
• The same information is recorded in multiple rows.
 
 For instance, if the office number changes, then there are multiple
updates that need to be made. 
 If these updates are not successfully completed across all rows, then an
inconsistency occurs.
Deletion Anomaly
• Deletion of a row can cause more than one set of facts to be
removed. 

 For instance, if John Hunt retires, then deleting that row cause use to
lose information about the New York office.

You might also like