Measures of Dispersion and Variability: Range, QD, AD and SD
Normalization in RDBMS.pptx
1. NORMALIZATION IN RDBMS
S.B.S.Younus M.Sc., M.Phil., NET.,
Assistant Professor,
Department of Information Technology,
Sadakathullah Appa College,
Tirunelveli.
Follow on YouTube: SBS Digital Learning
2. WHAT IS NORMALIZATION?
In a relational database management system
(RDBMS), there are several normal forms
(NFs) that help structure data to minimize
redundancy and improve data integrity.
3. NORMALIZATION TYPES
First Normal Form (1NF)
Second Normal Form (2NF)
Third Normal Form (3NF)
Boyce Code Normal Form (BCNF)
Fourth Normal Form (4NF)
Fifth Normal Form (5NF)
4. FIRST NORMAL FORM (1NF)
Ensures that each column in a table
contains only atomic (indivisible)
values.
Example: Consider a table named
"Students" with a column "Phone
Numbers" that contains multiple phone
numbers in a single cell.
To achieve 1NF, we have to split the
phone numbers into separate rows, each
associated with a student.
5. SECOND NORMAL FORM (2NF)
Extends 1NF and adds the requirement
that each non-key column is
functionally dependent on the entire
primary key.
Example: In a "Course Registration" table
with student and course data, if the
primary key is a combination of student ID
and course ID, you should ensure that any
data related to a course depends on both
student ID and course ID.
6. THIRD NORMAL FORM (3NF)
Extends 2NF and ensures that there is
no transitive dependency between non-
key columns.
Example: In a "Library Books" table with
columns for "Author" and "Author's
Address," if the author's address depends
on the author's name, you should create a
separate "Authors" table to eliminate this
transitive dependency.
7. BOYCE CODE NORMAL FORM (BCNF)
BCNF is a stricter version of 3NF that
deals with certain types of anomalies
related to functional dependencies.
It states that, for any non-trivial functional
dependency X → Y in a relation, X must
be a superkey (a set of attributes that
uniquely identifies a tuple).
8. BCNF EXAMPLE
Consider a "Students" table with attributes
(columns) like StudentID, Course, and
Professor.
If you have a functional dependency where
Course → Professor (i.e., each course is
taught by a unique professor), and Course is
not a superkey by itself, you need to
decompose the table to meet BCNF.
You'd create a new table for Courses and
Professors, ensuring that Course (or a
combination of attributes) serves as the key
in the Courses table.
9. FOURTH NORMAL FORM (4NF)
4NF addresses multi-valued
dependencies, where an attribute can
have multiple values for a single set of
other attributes.
It requires that a relation be in BCNF and
that there are no non-trivial multi-valued
dependencies.
10. 4NF EXAMPLE
Imagine a "Orders" table with attributes
OrderID, CustomerName, and Item.
If a single order can have multiple items,
you'd split the table into "Orders" (containing
OrderID and CustomerName) and
"OrderItems" (containing OrderID and Item),
ensuring that no multi-valued
dependencies exist.
11. FIFTH NORMAL FORM (5NF)
5NF addresses cases where a relation
contains join dependencies, ensuring that
data can be reconstructed from decomposed
tables without loss of information.
It is used to handle complex cases where a
relation needs to be split into multiple tables
and joined when queried.
12. 5NF EXAMPLE
Suppose you have a "Library" database
with a "Books" table and a "Authors" table.
5NF would ensure that even after
decomposing, you can still accurately
retrieve information like which author
wrote which book, by performing joins
between the "Books" and "Authors" tables.
13. CONCLUSION
Normal forms help organize data in a way
that reduces redundancy and anomalies in a
relational database, promoting data accuracy
and consistency.
Higher normal forms like BCNF, 4NF and
5NF address more complex dependencies
and can be applied in specific scenarios as
needed.