0% found this document useful (0 votes)
89 views

Normalization

Normalization is the process of organizing data in a database to minimize redundancy and dependency. It divides larger tables into smaller tables and links them using relationships. Normalization helps eliminate data anomalies during insertion, updating, and deletion of records. It involves decomposing tables and then recomposing them in a hierarchical structure of relations.

Uploaded by

Geethika Snis
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)
89 views

Normalization

Normalization is the process of organizing data in a database to minimize redundancy and dependency. It divides larger tables into smaller tables and links them using relationships. Normalization helps eliminate data anomalies during insertion, updating, and deletion of records. It involves decomposing tables and then recomposing them in a hierarchical structure of relations.

Uploaded by

Geethika Snis
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/ 25

Normalization

Normalization
• Normalization is the process of organizing the
data in the database.
• Normalization is used to minimize the
redundancy from a relation or set of relations.
• It is also used to eliminate the undesirable
characteristics like Insertion, Update and
Deletion Anomalies.
• Normalization divides the larger table into the
smaller table and links them using relationship.
• Normalization divides the larger table into the
smaller table and links them using
relationship.
• The normal form is used to reduce
redundancy from the database table.
• Decomposition
• Recomposition
• Loss-less join decomposiiton
• 1NF
A relation is in 1NF if it contains atomic values.
• 2NF
A relation will be in 2NF if it is in 1NF and all non-key attributes
are fully functional dependent on the primary key.
• 3NF
A relation will be in 3NF if it is in 2NF and no
transition(transitive) dependency exists.
• 4NF
A relation will be in 4NF if it is in Boyce Codd normal form and
has no multi-valued dependency.
• 5NF
A relation is in 5NF if it is in 4NF and not contains any join
dependency and joining should be lossless.
First Normal Form (1NF)
• A relation will be 1NF if it contains atomic
values
• It states that an attribute of a table cannot
hold multiple values.
• It must hold only single-valued attribute.
• First normal form disallows the multi-valued
attribute, composite attribute, and their
combinations.
Relation EMPLOYEE is not in 1NF because
of multi-valued attribute EMP_PHONE.

EmpID EmpName EmpPhone EmpState


14 John 7272826385 UP
,
9064738238
20 Harry 8574783832 Bihar
7390372389
12 Sam , Punjab
8589830302
The decomposition of the EMPLOYEE
table into 1NF has been shown below:
EMPID EMPNAME EMPPHONE EMPSTATE
14 John 7272826385 UP
14 John 9064738238 UP
20 Harry 8574783832 Bihar
12 Sam 7390372389 Punjab
12 Sam 8589830302 Punjab
Second Normal Form (2NF)
• A relation will be in 2NF if it is in 1NF and all
non-key attributes are fully functional
dependent on the primary key.
• In the 2NF, relation must be in 1NF.
• All non-key attributes are fully functional
dependent(FD) on the primary key
Let's assume, An educational institute store the data of teachers
and the subjects they teach. Here, a faculty can teach more than
one subject.
FACULTYID COURSE TEACHING FACULTYAGE
25 Chemistry 30
25 Biology 30
47 English 35
83 Math 38
83 Computer 38

In the given table, the attribute FACULTYAGE is dependent ON


FACULTYID which is a proper subset of a candidate key. That's
why it violates the rule for 2NF.
FACULTYID FACULTYAGE

25 30

47 35

83 38
FACULTYID COURSETEACHING
25 Chemistry
25 Biology
47 English
83 Math
83 Computer
Third Normal Form (3NF)
• A relation will be in 3NF if it is in 2NF and not
contain any transitive partial dependency.
• 3NF is used to reduce the data duplication. It
is also used to achieve the data integrity.
• If there is no transitive dependency for non-
prime attributes, then the relation must be in
third normal form.
• A relation is in third normal form if it holds
atleast one of the following conditions for
every non-trivial function dependency X → Y.
• X is a super key.
• Y is a prime attribute, i.e., each element of Y is
part of some candidate key.
FD, TD and MVD
• Functional Dependency (FD) determines the
relation of one attribute to another attribute in a
database management system (DBMS) .
• Functional dependency helps to maintain the
quality of data in the database.
• A functional dependency is denoted by an arrow →.
• The functional dependency of X on Y is represented
by X → Y.
• Functional Dependency plays a vital role to find the
difference between good and bad database design
Employee Employee Salary City
number Name
1 Dana 50000 San
Francisco
2 Francis 38000 London
3 Andrew 25000 Tokyo

Inthis example, if we know the value of Employee number, we


can obtain Employee Name, city, salary, etc. By this, we can say
that the city, Employee Name, and salary are functionally
depended on Employee number.

Determinant -> Dependent


Decomposition & Rules for FD
• It is a rule that suggests if a table that appears to contain two
entities which are determined by the same primary key then it
should be considered for breaking them up into two different
tables.
• Reflexive rule –. If X is a set of attributes and Y is_subset_of X,
then X holds a value of Y.
• Augmentation rule: When x -> y holds, and c is attribute set, then
ac -> bc also holds. That is adding attributes which do not change
the basic dependencies.
• Transitivity rule: This rule is very much similar to the transitive
rule in algebra if x -> y holds and y -> z holds, then x -> z also
holds. X -> y is called as functionally that determines y.
Types of Functional Dependencies

• Trivial functional dependency


• Non-trivial functional dependency
• Transitive dependency
• Multivalued dependency
Trivial
• The Trivial dependency is a set of attributes
which are called a trivial if the set of attributes
are included in that attribute.
• So, X -> Y is a trivial functional dependency if Y
is a subset of X.
Emp_id Emp_name
AS555 Harry
AS811 George
AS999 Kevin

{Emp_id, Emp_name} -> Emp_id is a trivial functional dependency as Emp_id is a


subset of {Emp_id,Emp_name}.
Non-Trivial Functional Dependency
• Functional dependency which also known as a
nontrivial dependency occurs when A->B
holds true where B is not a subset of A.
• In a relationship, if attribute B is not a subset
of attribute A, then it is considered as a non-
trivial dependency.
Company CEO Age
Microsoft Satya Nadella 51
Google Sundar Pichai 46
Apple Tim Cook 57

Company -> CEO (if we know the Company, we knows


the CEO name)
But CEO is not a subset of Company, and hence it's
non-trivial functional dependency.
Transitive Dependency-
transitive dependency can only occur in a relation of three or more attributes.

• A transitive is a type of functional dependency


which happens when t is indirectly formed by
two functional dependencies.
Company CEO Age
Microsoft Satya Nadella 51
Google Sundar Pichai 46
Apple Tim Cook 57

Company -> CEO(if we know the company, we know its CEO's name)
CEO -> Age If we know the CEO, we know the Age
Therefore according to the rule of rule of transitive dependency:
Company -> Age should hold, that makes sense because if we know the
company name, we can know his age.
Summary of Normalization
• Normalization is a method of organizing the data in
the database which helps you to avoid data
redundancy, insertion, update & deletion anomaly. It
is a process of analyzing the relation schemas based
on their different functional dependencies and
primary key.
• Normalization is inherent to relational database
theory. It may have the effect of duplicating the
same data within the database which may result in
the creation of additional tables.
Advantages of Functional Dependency

• Functional Dependency avoids data redundancy.


Therefore same data do not repeat at multiple
locations in that database
• It helps to maintain the quality of data in the database
• It helps to define meanings and constraints of
databases
• It helps to identify bad designs
• It helps to find the facts regarding the database design
Overview of FDs
• Functional Dependency is when one attribute determines another attribute
in a DBMS system.
• Axiom, Decomposition, Dependent, Determinant, Union are key terms for
functional dependency
• Four types of functional dependency are 1) Multivalued 2) Trivial 3) Non-
trivial 4) Transitive
• Multivalued dependency occurs in the situation where there are multiple
independent multivalued attributes in a single table
• The Trivial dependency occurs when a set of attributes which are called a
trivial if the set of attributes are included in that attribute
• Nontrivial dependency occurs when A->B holds true where B is not a subset
of A
• A transitive is a type of functional dependency which happens when it is
indirectly formed by two functional dependencies
• Normalization is a method of organizing the data in the database which
helps you to avoid data redundancy

You might also like