Professional Documents
Culture Documents
SCHEMA REFINEMENT
Table Of Contents
● Schema Refinement
● Problems Caused By Redundancy
● Use Of Decompositions
● Problems Related To Decomposition
● Functional Dependencies
● Types Of Functional Dependencies
● Normalization
• First Normal Form
• Second Normal Form
• Third Normal Form
• Boyce-codd Normal Form
• Fourth Normal Form
• Fifth Normal Form
SCHEMA REFINEMENT
Schema refinement refers to the process of improving or enhancing the structure and
organization of a database or data model. It's about making sure things are arranged
neatly and logically so that it's easy to find what you need and the database works
efficiently. Schema refinement aims to fix problems in how data is organized in a
database. The main issue it tackles is storing the same information multiple times, which
wastes space and makes things confusing.
To solve this, we use a method called decomposition, which means breaking down the
data into smaller, more organized pieces. However, decomposition can create its own
problems if not done carefully.
REDUNDANCY& ANOMALIES
● Redundancy refers to repetition of same data or duplicate copies of same data stored in
different locations. Anomalies:
● Anomalies refers to the problems occurred after poorly planned and normalized
databases where all the data is stored in one table which is sometimes called a flat file
database. Let us consider such type of schema –
Due to redundancy of data we may get the following problems, those are-
1. Redundant\Wasted Storage Space: Storing the same information multiple times takes up
unnecessary space in the database.
2.Insertion Anomalies : It may not be possible to store some information unless some other
information is stored as well.
3.Update Anomalies: If one copy of redundant data is updated, then inconsistency is created
unless all redundant copies of data are updated.
4.Deletion Anomalies: It may not be possible to delete some information without losing some
other information as well.
Problem In Updation / Updation Anomaly – If there is updation in
the fee from 5000 to 7000, then we have to update FEE column in all
the rows, else data will become inconsistent.
Because of insertion of some data, It is forced to insert some other dummy data
Deletion Anomaly : Deletion of S3 student cause the deletion of course. Because
of deletion of some data forced to delete some other useful data.
Example
3 Ali 19 JAVA
Second Normal form
Rule for second Normal form:
• Table should be in Ist Normal form
• No partial dependency
Partial dependency
When there are two are more primary keys in one table is known as partial
dependency
Subject
Student
S ID S NAME Address Sub ID Sub Name
Score
Sc-ID Sc-S ID Sc-Sub ID Marks Teacher Sub ID Sub Name Teacher
Third Normal form
Rule for third Normal form:
• Table should be in 3rd NF
• No transitive dependency
Transitive dependency
When one column depends on a column which is not a primary key.
Score
Sc-ID S ID Sub ID Marks Exam-name Total marks
Exam
Exam-ID
+
Exam-name Total marks
Boyce-Codd Normal Form
Rule for BCNF
BCNF is the Advance version of the 3NF.
It is stricter than 3NF.
X Y, X is the super key of the table.
For BCNF, every table should be in 3NF and for every functional dependencies, LHS is
super key.
Super Key: A set of one or more attributes (columns) that uniquely identifies each row
(record) in a table.
Example
Employee_ID
I First_Name Last_Name Department
101 John Smith HR
102 Alice Johnson IT
103 Bob Williams Sales
104 Sarah Brown Marketing
Example
Employee_ID Project_ID Employee_Name Project_Name Department
Project Table:
Project_ID Project_Name
501 Project X
502 Project Y
503 Project Z
Employee-Project Table:
Employee_ID Project_ID
101 501
102 502
103 501
104 503
Fourth Normal Form
A relation will b in 4Nf if it is in BCNF and has no multi-valued Dependency.
Multi-valued Dependency:
MVD occurs when two or more independent multi-valued facts about
the same attribute occurs with in same relation.
MVD is denoted by X Y. there is a multivalued of dependency of Y or
multi-determines of X
Kailash Placement
Kailash Scholarship
Faculty-Course
faculty subject
Kailash DBMS
Kailash JAVA
Kailash C
Fifth Normal Form
The 5NF also known as 5th Normal form.
A relations is in fifth Normal form, if it is in 4NF,and would not have lossless decomposition in to smaller
table.
5NF is satisfied when all the tables are broken in to many tables as possible in order to avoid redundancy.
After that you combined these all tables if it is equal to the original table then 5NF.
Kailash Placement
Kailash Scholarship
Faculty-Course
faculty subject
Kailash DBMS
Kailash JAVA
Kailash C
Combined