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

Normalisation

Uploaded by

Sudha G
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)
15 views

Normalisation

Uploaded by

Sudha G
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/ 23

Introduction to

Normalization in
DBMS
Normalization is a fundamental concept in database design that aims to organize
a database in a way that reduces redundancy, minimizes data anomalies, and
ensures data integrity. It involves a series of steps that transform a database
schema to achieve these goals, making the database more efficient and easier to
maintain.

by Sudha G
Importance of Normalization
Normalization is a crucial process in database design that
helps reduce data redundancy, improve data integrity, and
enhance the overall performance of a database. It is
essential for maintaining a well-structured and efficient
database system, which is crucial for businesses and
organizations that rely on data-driven decision-making.

By applying normalization techniques, databases can be


structured in a way that eliminates repeating groups of data,
ensures data consistency, and minimizes the risk of data
anomalies. This, in turn, reduces the likelihood of errors,
improves data retrieval, and simplifies database maintenance
and management.

Normalized databases also provide better scalability and flexibility,


as they can accommodate changes and growth in data requirements
more efficiently. This is particularly important in today's rapidly
evolving business environments, where the ability to adapt to
changing data needs is crucial for maintaining a competitive edge.
First Normal Form (1NF)
1 Eliminate Repeating 2 Unique Identification 3 Atomic Values
Groups
In 1NF, all attributes in the
The first normal form 1NF also mandates that table must be atomic,
(1NF) requires that the each row in the table must meaning they cannot be
database table have no be uniquely identifiable, further divided into smaller
repeating groups. This typically through the use of parts. This helps to
means that each attribute in a primary key. This maintain data consistency
the table must contain a primary key ensures that and simplifies data
single value, not a list of each record in the table is retrieval and manipulation
values. This helps to distinct and can be processes.
ensure data integrity and accessed or referenced
simplifies data individually.
manipulation operations.
1. First Normal Form
(1NF)
A database table is said
to be in 1NF if it
contains no repeating
fields/columns. The
process of converting
the UNF table into 1NF
is as follows:
1.Separate the
repeating fields into
new database tables
along with the key
from the unnormalized
database table.
2.The primary key of
new database tables
may be the
composite key.
Second Normal Form (2NF)

Understanding 2NF Identifying Partial Achieving 2NF


Dependencies
The Second Normal Form (2NF) To achieve 2NF, the solution is to
is a database design principle that In a table that does not satisfy break the table into multiple
builds upon the First Normal 2NF, there may be non-key tables, each with a primary key
Form (1NF). It requires that all attributes that depend on only a that fully determines all non-key
non-key attributes be fully part of the primary key. These attributes. This process eliminates
dependent on the primary key, partial dependencies can lead to partial dependencies and results in
with no partial dependencies. This data duplication and potential a more normalized database
helps eliminate data redundancy update anomalies, which 2NF design, improving data integrity
and ensures data integrity within aims to resolve. and reducing redundancy.
the database.
2. Second Normal Form (2NF)
The process of converting the
database table into 2NF is as
follows:
1.Remove the partial dependencies
(A type of functional dependency
where a field is only functionally
dependent on the part of the
primary key) of any non-key field.
2.If field B depends on field A and
vice versa. Also for a given value
of B, we have only one possible
value of A and vice versa, Then we
put the field B into a new database
table where B will be the primary
key and also marked as a foreign
key in a parent table.
Third Normal Form (3NF)
Definition Principles Benefits Examples

The Third Normal To achieve 3NF, a 3NF helps eliminate For instance, a table
Form (3NF) is a table must meet two data redundancy, that tracks student
database key requirements: 1) reduce data anomalies, information might
normalization rule that All non-key attributes and improve data have columns for
states that a table must must be fully integrity. It also student ID, name,
be free from transitive dependent on the simplifies database address, and the ID of
dependencies. This primary key, and 2) design and makes it the student's assigned
means that all There must be no easier to maintain and advisor. In 3NF, the
attributes in a table transitive update the database advisor ID would
should depend directly dependencies, where over time. depend directly on the
on the primary key, one non-key attribute student ID, and not on
and not on any other depends on another any other non-key
non-key attribute. non-key attribute. attribute.
3. Third Normal Form (3NF)
. The process of converting the
table into 3NF is as follows:
1.Remove the transitive
dependencies(A type of
functional dependency where a
field is functionally dependent on
the Field that is not the primary
key. Hence its value is
determined, indirectly by the
primary key )
2.Make a separate table for
transitive-dependent Fields.
Boyce-Codd Normal Form (BCNF)

Definition Eliminating Partial Simplifying Data Structure


Dependencies
Boyce-Codd Normal Form
(BCNF) is a higher level of BCNF ensures that there are no By enforcing BCNF, the database
normalization that addresses partial dependencies in the data, structure becomes simpler and
certain types of anomalies not meaning that all attributes are more intuitive, making it easier to
covered by the Third Normal fully dependent on the primary manage and query the data. This
Form (3NF). It requires that every key. This helps to eliminate improves the overall efficiency
determinant in a relation must be a update, insertion, and deletion and reliability of the database
candidate key. anomalies. system.
4. Boyce Code Normal Form
(BCNF)
A database table is said to be
in BCNF if it is in 3NF and
contains every determinant
as a candidate key. The
process of converting the
table into BCNF is as
follows:
1.Remove the nontrivial
functional dependency.
2.Make a separate table for
the determinants.
NORMALIZATION
Normalization is the process of organizing data in a database.
It includes creating tables and establishing relationships between
those tables according to rules designed both to protect the data and
to make the database more flexible by eliminating redundancy and
inconsistent dependency.
Redundant data wastes disk space and creates maintenance
problems.
If data that exists in more than one place must be changed, the data
must be changed in exactly the same way in all locations.
A customer address change is easier to implement if that data is
stored only in the Customers table and nowhere else in the database.
There are a few rules for database normalization.
Each rule is called a "normal form."
If the first rule is observed, the database is said to be in "first
normal form."
If the first three rules are observed, the database is considered
to be in "third normal form."
Although other levels of normalization are possible, third
normal form is considered the highest level necessary for most
applications.
Unnormalized table:

Student_No Mentor Dept.No Class1 Class2 Class3

1022 Asha 501 101-07 143-01 159-02

4123 Sakshi 510 101-07 143-01 179-04


First normal form : No repeating groups
•Eliminate repeating groups in individual tables.
•Create a separate table for each set of related data.
•Identify each set of related data with a primary key.
Don't use multiple fields in a single table to store similar data

Tables should have only two dimensions. Since one student has several classes,

these classes should be listed in a separate table. Fields Class1, Class2, and

Class3 in the above records are indications of design trouble.


Don't put the one side and the many sides in the same table. Instead, create
another table in first normal form by eliminating the repeating group
(Class#),
Student_No Mentor Dept.No Class_No

1022 Asha 501 101-07

1022 Asha 501 143-01

1022 Asha 501 159-02

4123 Sakshi 510 101-07

4123 Sakshi 510 143-01

4123 Sakshi 510 179-04


Second normal form - Eliminate redundant data
•Create separate tables for sets of values that apply to multiple records.
•Relate these tables with a foreign key.
Records shouldn't depend on anything other than a table's primary key (a
compound key, if necessary). For example, consider a customer's address in
an accounting system. The address is needed by the Customers table, but
also by the Orders, Shipping, Invoices, Accounts Receivable, and
Collections tables. Instead of storing the customer's address as a separate
entry in each of these tables, store it in one place, either in the Customers
table or in a separate Addresses table.
Note the multiple Class# values for each Student# value in the above table. Class#
isn't functionally dependent on Student# (primary key), so this relationship isn't in
second normal form.
STUDENT :
Student_No Mentor Dept_No
1022 Asha 412
4123 Sakshi 216

REGISTRATIONS :
Student_No Class_No
1022 101-07
1022 143-01
1022 159-02
4123 101-07
4123 143-01
4123 179-04
Third Normal Form - Eliminate fields that don't depend on the key.
The next step is called third normal form. This is a common place to end the SQL
normalization process, because the design allows for efficient SQL queries and
addresses the issues of databases that aren't normalised.
A design will meet third normal form if it has no "transitive functional dependency".
A "transitive functional dependency" means that every attribute that is not the primary
key is dependent on only the primary key.
For example, in one table:
•Column A determines Column B
•Column B determines Column C
In the last example, Dept_No (the Mentor’s office number) is functionally dependent
on the Mentor attribute. The solution is to move that attribute from the Students table
to the Faculty table, as shown below:
STUDENTS
Student_No Mentor
1022 Asha
4123 Sakshi

FACULTY :

Name Dept_No Dept


Asha 412 42
Sakshi 216 42
Fourth Normal Form (4NF)
Eliminate Multivalued Enhances Data Integrity
Dependencies
By eliminating multivalued dependencies,
Fourth Normal Form (4NF) addresses the 4NF improves data integrity and reduces the
issue of multivalued dependencies, which risk of data anomalies, such as update,
occur when a single attribute can have insertion, and deletion anomalies. This results
multiple values associated with it. 4NF in a more robust and reliable database design.
ensures that each attribute is independent and
not dependent on any other attribute,
eliminating the need for repeating groups or
multi-valued data.

Simplifies Queries and Transactions


A database in 4NF has a simpler structure, making it easier to write and understand queries. It also
reduces the complexity of data manipulation, as there are fewer dependencies between attributes,
simplifying transactions and data operations.
Fifth Normal Form (5NF)

Comprehensive
Normalization Complex Data Practical Tradeoffs
Fifth Normal Form (5NF), Structures While 5NF provides the strongest
also known as Project-Join Achieving 5NF requires a theoretical guarantees of data integrity,
Normal Form, is the highest deep understanding of the it may not always be the most practical
level of database relationships between or efficient approach in real-world
normalization. It ensures entities in the database. It database applications. Designers must
that a table is free from all involves decomposing balance the benefits of normalization
types of update, insertion, tables into smaller tables against factors like query performance,
and deletion anomalies by that represent the storage requirements, and development
eliminating unnecessary fundamental, irreducible complexity. The choice of
functional dependencies and facts about the problem normalization level often depends on
join dependencies. 5NF is domain. This process can the specific needs and constraints of
rarely required in practice, lead to very granular, the project.
but it provides a rigorous complex data structures that
theoretical foundation for may be challenging to
database design. implement and maintain.
Examples of Normalization
To illustrate the concepts of normalization in database
design, let's consider a simple example. Imagine a
database for a small bookstore that tracks information
about books, authors, and publishers.

In the initial, unnormalized table, we might have


columns for book title, author name, publisher name,
publication year, and price. However, this design
violates the principles of normalization, as it can lead
to data redundancy and anomalies.

By applying the normalization process, we can create


a more efficient and reliable database structure. For
instance, we can separate the information into three
tables: Books, Authors, and Publishers, each with its
own set of attributes and relationships.
Benefits and Drawbacks of Normalization

Improved Data Integrity Reduced Storage Requirements


Normalization helps eliminate data redundancy, By eliminating redundant data, normalization can
ensuring data consistency and reducing the risk of significantly reduce the storage space required for
data corruption. This leads to more accurate and a database, leading to more efficient use of system
reliable information, which is crucial for effective resources and lower maintenance costs.
decision-making and operational efficiency.

Increased Performance Complexity and Overhead


Normalized databases often have simpler and The process of normalization can be complex and
more efficient data structures, which can result in time-consuming, especially for large and complex
faster data retrieval and processing times. This databases. Additionally, the additional joins
can be particularly beneficial for large-scale required in a normalized database can introduce
applications with high transaction volumes. overhead and potentially impact performance for
certain types of queries.

You might also like