SlideShare a Scribd company logo
13
Most read
18
Most read
19
Most read
Database Design &
Normalization
UNIT-III
Determinant and Dependent
• The expression X → Y means 'if I know the value of X, then I can obtain the value of Y' (in a table
or somewhere).
• In the expression X → Y, X is the determinant and Y is the dependent attribute.
• The value X determines the value of Y.
• The value Y depends on the value of X.
Functional Dependencies (FD)
• An attribute is functionally dependent if its value is determined by another attribute which is a
key.
• That is, if we know the value of one (or several) data items, then we can find the value of
another (or several).
• Functional dependencies are expressed as X → Y, where X is the determinant and Y is the
functionally dependent attribute.
• If A →(B,C) then A → B and A → C.
• If (A,B) → C, then it is not necessarily true that A → C and B → C.
• If A → B and B → A, then A and B are in a 1-1 relationship.
• If A → B then for A there can only ever be one value for B.
…
• Functional dependency is a relationship that exists when one attribute uniquely determines
another attribute.
• If R is a relation with attributes X and Y, a functional dependency between the attributes is
represented as X->Y, which specifies Y is functionally dependent on X. Here X is a determinant
set and Y is a dependent attribute. Each value of X is associated precisely with one Y value.
• Functional dependency in a database serves as a constraint between two sets of attributes.
Defining functional dependency is an important part of relational database design and
contributes to aspect normalization.
Example: In a table with attributes of employee name and Social Security number (SSN),
employee name is functionally dependent on SSN because the SSN is unique for individual
names. An SSN identifies the employee specifically, but an employee name cannot distinguish
the SSN because more than one employee could have the same name.
Transitive Dependencies (TD)
• An attribute is transitively dependent if its value is determined by another attribute which is not
a key.
• If X → Y and X is not a key then this is a transitive dependency.
• A transitive dependency exists when A → B → C but NOT A → C.
Multi-Valued Dependencies (MVD)
• A table involves a multi-valued dependency if it may contain multiple values for an entity.
• X→Y, i.e. X multi-determines Y, when for each value of X we can have more than one value of Y.
• If A→B and A→C then we have a single attribute A which multi-determines two other
independent attributes, B and C.
• If A→(B,C) then we have an attribute A which multi-determines a set of associated attributes, B
and C.
Why Normalization: Redundancy
Roll No. Name Age Branch Branch ID
1 Anmol 24 CSE 101
2 Ansh 23 CSE 101
3 Akshay 25 CSE 101
4 Bhuvnesh 26 CSE 101
Anomalies of Database
Update anomalies āˆ’ If data items are scattered and are not linked to each other properly, then it
could lead to strange situations. For example, when we try to update one data item having its
copies scattered over several places, a few instances get updated properly while a few others
are left with old values. Such instances leave the database in an inconsistent state.
In the above example if the branch code 101 is updated to 102, in that case we need to update
all the rows.
Deletion anomalies āˆ’ We tried to delete a record, but parts of it was left undeleted because of
unawareness, the data is also saved somewhere else.
In the above slide example, when we delete all the record of students automatically the data of
branch name and branch id is getting deleted, which is not required to delete. We are deleting
student information because of which branch information is also being deleted.
Insert anomalies āˆ’ We tried to insert data in a record that does not exist at all.
Normalization
Normalization is a method to remove all these anomalies and bring the database to a consistent
state or we can say it is the process to remove redundancy.
It contains 4 ways to resolve anomalies using 4 normal forms.
1. First Normal Form
2. Second Normal Form
3. Third Normal Form
4. Boyce-Codd Normal Form
First Normal Form
First Normal Form is defined in the
definition of relations (tables) itself.
This rule defines that all the attributes
in a relation must have atomic domains.
The values in an atomic domain are
indivisible units.
We re-arrange the relation (table), to
convert it to First Normal Form.
Before Normalization
After Normalization
Second Normal Form
If we follow second normal form, then
every non-prime attribute should be
fully functionally dependent on prime
key attribute. That is, if X → A holds,
then there should not be any proper
subset Y of X, for which Y → A also
holds true. Prime Key Attributes: Stud_ID, Proj_ID
Non Key Attributes: Stu_Name, Proj_Name
As per rule: Non-key attributes, i.e. Stu_Name
and Proj_Name must be dependent upon both
and not on any of the prime key attribute
individually.
But we find that Stu_Name can be
identified by Stu_ID and Proj_Name can
be identified by Proj_ID independently.
This is called partial dependency, which is
not allowed in Second Normal Form.
…
Third Normal Form
For a relation to be in Third Normal Form, and the following must satisfy āˆ’
• It must be in Second Normal form
• No non-prime attribute is transitively dependent on prime key attribute.
• Every non-prime attribute of R is non-transitively dependent on every key of R.
We find that in the above Student_detail relation, Stu_ID is the key and only prime key
attribute. We find that City can be identified by Stu_ID as well as Zip itself. Neither Zip is a
superkey nor is City a prime attribute. Additionally, Stu_ID → Zip → City, so there
exists transitive dependency.
…
Boyce-Codd Normal Form
Boyce-Codd Normal Form (BCNF) is an extension of Third Normal Form on strict terms. BCNF
states that āˆ’
For any non-trivial functional dependency, X → A, X must be a super-key.
In the above image, Stu_ID is the super-key in the relation Student_Detail and Zip is the super-
key to the relation ZipCodes. So,
Stu_ID → Stu_Name, Zip
and
Zip → City
Which confirms that both the relations are in BCNF.
Loss-less join Decomposition
• Decomposition – the process of breaking down in parts or elements.
• Decomposition in database means breaking tables down into multiple tables From Database
perspective means going to a higher normal form.
• Important that decompositions are ā€œgoodā€,
• Two Characteristics of Good Decompositions
1) Lossless: Means functioning without a loss. In other words, retain everything after being
break in two or more tables.
2) Preserve dependencies
Lossless Decomposition
Sometimes the same set of data is
reproduced:
(Word, 100) + (Word, WP)  (Word, 100, WP)
(Oracle, 1000) + (Oracle, DB)  (Oracle, 1000, DB)
(Access, 100) + (Access, DB)  (Access, 100, DB)
Name Price Category
Word 100 WP
Oracle 1000 DB
Access 100 DB
Name Price
Word 100
Oracle 1000
Access 100
Name Category
Word WP
Oracle DB
Access DB
Lossy Decomposition
Sometimes it’s not:
(Word, WP) + (100, WP) = (Word, 100, WP)
(Oracle, DB) + (1000, DB) = (Oracle, 1000, DB)
(Oracle, DB) + (100, DB) = (Oracle, 100, DB)
(Access, DB) + (1000, DB) = (Access, 1000, DB)
(Access, DB) + (100, DB) = (Access, 100, DB)
Name Price Category
Word 100 WP
Oracle 1000 DB
Access 100 DB
Category Name
WP Word
DB Oracle
DB Access
Category Price
WP 100
DB 1000
DB 100
What’s
wrong?
Column Name Data Type
supplierID(primary key) Int
suppliername varchar(20)
products varchar(20)
SupplierID Supplier Name Products
1 Yeki Inc. tshirt, shirt, jeans
Column Name Data Type
supplierID(primary key) Int
suppliername varchar(20)
Column Name Data Type
Productid Int
Productname varchar(20)
Supplierid Int
Suppliers
Suppliers
Products
Column Name Data Type
Productid Int
Productname varchar(20)
StoreName Varchar(20)
Price int
Products
ProductID ProductName StoreName Price
1 Blue Shirt Store1 2000
2 White Shirt Store2 2300
3 Grey Shirt Store5 2200
4 Blue Shirt Store4 2000
Column Name Data Type
Productid Int
Productname varchar(20)
Price int
Column Name Data Type
Storeid Int
StoreName varchar(20)
ProductName Varchar(20)
Products Stores
1. There should not be any partial key
dependencies. Attribute must be
depended upon key.
2. Another principle is there should not
be no derived data or calculated
fields, such as total, while you have
price and quantity in the table.
Here product is dependent on store but
the attributes don’t have to be depend
only on key, so product name in this case
does depend on store, but it doesn’t
only depend on store for its existence.
Column Name Data Type
Productid Int
Productname varchar(20)
Price int
Column Name Data Type
Storeid Int
StoreName varchar(20)
Column Name Data Type
Storeid Int
Productid varchar(20)
Products Stores
Inventory
Attribute must be
solely dependent
upon the key.
Third normal form essentially removes the transitive dependency.
BCNF
StudentID Name Course Duration
1 Tom Java 60
2 Jerry Database 90
3 Duck Database Adv 100
4 Donalds Database 100
THANKS

More Related Content

What's hot (20)

PPTX
Introduction To Data Structures.
Education Front
Ā 
PPTX
joins in database
Sultan Arshad
Ā 
PPT
10. XML in DBMS
koolkampus
Ā 
PPT
12. Indexing and Hashing in DBMS
koolkampus
Ā 
PPTX
Normalization in DBMS
Prateek Parimal
Ā 
PPTX
introduction to NOSQL Database
nehabsairam
Ā 
PPTX
Object relational database management system
Saibee Alam
Ā 
PPTX
Mongodb - NoSql Database
Prashant Gupta
Ā 
PPT
Heaps
Hafiz Atif Amin
Ā 
PPTX
Relational Database Design
Archit Saxena
Ā 
PPT
11. Storage and File Structure in DBMS
koolkampus
Ā 
PPTX
Arrays in Data Structure and Algorithm
KristinaBorooah
Ā 
PPTX
Relational databases vs Non-relational databases
James Serra
Ā 
PPT
1.2 steps and functionalities
Krish_ver2
Ā 
PPTX
Query processing and optimization (updated)
Ravinder Kamboj
Ā 
PPTX
Query processing
Dr. C.V. Suresh Babu
Ā 
PPT
Normalisation - 2nd normal form
college
Ā 
PPTX
Tree in data structure
ghhgj jhgh
Ā 
PPT
Data Warehouse Basic Guide
thomasmary607
Ā 
PPTX
Dynamic Itemset Counting
Tarat Diloksawatdikul
Ā 
Introduction To Data Structures.
Education Front
Ā 
joins in database
Sultan Arshad
Ā 
10. XML in DBMS
koolkampus
Ā 
12. Indexing and Hashing in DBMS
koolkampus
Ā 
Normalization in DBMS
Prateek Parimal
Ā 
introduction to NOSQL Database
nehabsairam
Ā 
Object relational database management system
Saibee Alam
Ā 
Mongodb - NoSql Database
Prashant Gupta
Ā 
Relational Database Design
Archit Saxena
Ā 
11. Storage and File Structure in DBMS
koolkampus
Ā 
Arrays in Data Structure and Algorithm
KristinaBorooah
Ā 
Relational databases vs Non-relational databases
James Serra
Ā 
1.2 steps and functionalities
Krish_ver2
Ā 
Query processing and optimization (updated)
Ravinder Kamboj
Ā 
Query processing
Dr. C.V. Suresh Babu
Ā 
Normalisation - 2nd normal form
college
Ā 
Tree in data structure
ghhgj jhgh
Ā 
Data Warehouse Basic Guide
thomasmary607
Ā 
Dynamic Itemset Counting
Tarat Diloksawatdikul
Ā 

Similar to Database Design and Normalization Techniques (20)

PPTX
Database normalization
Edward Blurock
Ā 
PDF
Database normalization
Asar Theen
Ā 
PDF
Mba ebooks ! Edhole
Edhole.com
Ā 
PDF
Normalization in Database
Roshni Singh
Ā 
PPTX
database Normalization
Harsiddhi Thakkar
Ā 
PPT
DBMS e evevevevevevevbebrbbrbrbrbrbrbrb 4.ppt
7c7fs5n555
Ā 
PPTX
L1-Normalization 1NF 2NF 3NF 4NF BCNF.pptx
ChandrashekharSingh859453
Ā 
PPTX
Data Modeling
DrkhanchanaR
Ā 
PPTX
Database normalization
Jignesh Jain
Ā 
DOCX
Normalization
Bathshebaparimala
Ā 
PDF
24042020_normalization 1.pdf
Shivani139202
Ā 
PPT
NormalizationDetailswithexample12345.ppt
DrSomyaDubey
Ā 
PPTX
Normalization
Ahmed Farag
Ā 
PPT
E02Normalization.ppt
NelsonZaidi
Ā 
PPT
E02Normalization.ppt
Ily Lovekotoh
Ā 
PDF
Normalization | (1NF) |(2NF) (3NF)|BCNF| 4NF |5NF
Biplap Bhattarai
Ā 
PPTX
UNIT II DBMS.pptx
NIVETHA37590
Ā 
PDF
Normalization in DBMS
Pyingkodi Maran
Ā 
PPTX
normalization of database management ppt
RabiaKabir
Ā 
PDF
functionaldependenciesandnormalization-150628061940-lva1-app6891.pdf
Anvesha Joshi
Ā 
Database normalization
Edward Blurock
Ā 
Database normalization
Asar Theen
Ā 
Mba ebooks ! Edhole
Edhole.com
Ā 
Normalization in Database
Roshni Singh
Ā 
database Normalization
Harsiddhi Thakkar
Ā 
DBMS e evevevevevevevbebrbbrbrbrbrbrbrb 4.ppt
7c7fs5n555
Ā 
L1-Normalization 1NF 2NF 3NF 4NF BCNF.pptx
ChandrashekharSingh859453
Ā 
Data Modeling
DrkhanchanaR
Ā 
Database normalization
Jignesh Jain
Ā 
Normalization
Bathshebaparimala
Ā 
24042020_normalization 1.pdf
Shivani139202
Ā 
NormalizationDetailswithexample12345.ppt
DrSomyaDubey
Ā 
Normalization
Ahmed Farag
Ā 
E02Normalization.ppt
NelsonZaidi
Ā 
E02Normalization.ppt
Ily Lovekotoh
Ā 
Normalization | (1NF) |(2NF) (3NF)|BCNF| 4NF |5NF
Biplap Bhattarai
Ā 
UNIT II DBMS.pptx
NIVETHA37590
Ā 
Normalization in DBMS
Pyingkodi Maran
Ā 
normalization of database management ppt
RabiaKabir
Ā 
functionaldependenciesandnormalization-150628061940-lva1-app6891.pdf
Anvesha Joshi
Ā 
Ad

More from Nishant Munjal (20)

PPTX
Database Management System
Nishant Munjal
Ā 
PPTX
Functions & Recursion
Nishant Munjal
Ā 
PPTX
Array, string and pointer
Nishant Munjal
Ā 
PPTX
Programming in C
Nishant Munjal
Ā 
PPTX
Introduction to computers
Nishant Munjal
Ā 
PPTX
Unix Administration
Nishant Munjal
Ā 
PPTX
Shell Programming Concept
Nishant Munjal
Ā 
PPTX
VI Editor
Nishant Munjal
Ā 
PPTX
Introduction to Unix
Nishant Munjal
Ā 
PPTX
Routing Techniques
Nishant Munjal
Ā 
PPTX
Asynchronous Transfer Mode
Nishant Munjal
Ā 
PPTX
Overview of Cloud Computing
Nishant Munjal
Ā 
PPTX
SQL Queries Information
Nishant Munjal
Ā 
PPTX
Concurrency Control
Nishant Munjal
Ā 
PPTX
Transaction Processing Concept
Nishant Munjal
Ā 
PPTX
Database Management System
Nishant Munjal
Ā 
PPTX
Relational Data Model Introduction
Nishant Munjal
Ā 
PPTX
Virtualization, A Concept Implementation of Cloud
Nishant Munjal
Ā 
PPTX
Technical education benchmarks
Nishant Munjal
Ā 
PPSX
Bluemix Introduction
Nishant Munjal
Ā 
Database Management System
Nishant Munjal
Ā 
Functions & Recursion
Nishant Munjal
Ā 
Array, string and pointer
Nishant Munjal
Ā 
Programming in C
Nishant Munjal
Ā 
Introduction to computers
Nishant Munjal
Ā 
Unix Administration
Nishant Munjal
Ā 
Shell Programming Concept
Nishant Munjal
Ā 
VI Editor
Nishant Munjal
Ā 
Introduction to Unix
Nishant Munjal
Ā 
Routing Techniques
Nishant Munjal
Ā 
Asynchronous Transfer Mode
Nishant Munjal
Ā 
Overview of Cloud Computing
Nishant Munjal
Ā 
SQL Queries Information
Nishant Munjal
Ā 
Concurrency Control
Nishant Munjal
Ā 
Transaction Processing Concept
Nishant Munjal
Ā 
Database Management System
Nishant Munjal
Ā 
Relational Data Model Introduction
Nishant Munjal
Ā 
Virtualization, A Concept Implementation of Cloud
Nishant Munjal
Ā 
Technical education benchmarks
Nishant Munjal
Ā 
Bluemix Introduction
Nishant Munjal
Ā 
Ad

Recently uploaded (20)

PDF
Water Industry Process Automation & Control Monthly July 2025
Water Industry Process Automation & Control
Ā 
PPT
Footbinding.pptmnmkjkjkknmnnjkkkkkkkkkkkkkk
mamadoundiaye42742
Ā 
PPTX
Introduction to Internal Combustion Engines - Types, Working and Camparison.pptx
UtkarshPatil98
Ā 
PPTX
Distribution reservoir and service storage pptx
dhanashree78
Ā 
PPTX
Numerical-Solutions-of-Ordinary-Differential-Equations.pptx
SAMUKTHAARM
Ā 
PPTX
DATA BASE MANAGEMENT AND RELATIONAL DATA
gomathisankariv2
Ā 
PDF
Pressure Measurement training for engineers and Technicians
AIESOLUTIONS
Ā 
PDF
Submit Your Papers-International Journal on Cybernetics & Informatics ( IJCI)
IJCI JOURNAL
Ā 
PDF
AI TECHNIQUES FOR IDENTIFYING ALTERATIONS IN THE HUMAN GUT MICROBIOME IN MULT...
vidyalalltv1
Ā 
PDF
methodology-driven-mbse-murphy-july-hsv-huntsville6680038572db67488e78ff00003...
henriqueltorres1
Ā 
PPTX
fatigue in aircraft structures-221113192308-0ad6dc8c.pptx
aviatecofficial
Ā 
PPTX
GitOps_Without_K8s_Training_detailed git repository
DanialHabibi2
Ā 
PDF
Basic_Concepts_in_Clinical_Biochemistry_2018ŁƒŁŠŁ…ŁŠŲ§Ų”_Ų¹Ł…Ł„ŁŠ.pdf
AdelLoin
Ā 
PPTX
Worm gear strength and wear calculation as per standard VB Bhandari Databook.
shahveer210504
Ā 
PDF
Electrical Machines and Their Protection.pdf
Nabajyoti Banik
Ā 
PDF
SERVERLESS PERSONAL TO-DO LIST APPLICATION
anushaashraf20
Ā 
PDF
AN EMPIRICAL STUDY ON THE USAGE OF SOCIAL MEDIA IN GERMAN B2C-ONLINE STORES
ijait
Ā 
PPTX
Knowledge Representation : Semantic Networks
Amity University, Patna
Ā 
PDF
MODULE-5 notes [BCG402-CG&V] PART-B.pdf
Alvas Institute of Engineering and technology, Moodabidri
Ā 
PDF
Halide Perovskites’ Multifunctional Properties: Coordination Engineering, Coo...
TaameBerhe2
Ā 
Water Industry Process Automation & Control Monthly July 2025
Water Industry Process Automation & Control
Ā 
Footbinding.pptmnmkjkjkknmnnjkkkkkkkkkkkkkk
mamadoundiaye42742
Ā 
Introduction to Internal Combustion Engines - Types, Working and Camparison.pptx
UtkarshPatil98
Ā 
Distribution reservoir and service storage pptx
dhanashree78
Ā 
Numerical-Solutions-of-Ordinary-Differential-Equations.pptx
SAMUKTHAARM
Ā 
DATA BASE MANAGEMENT AND RELATIONAL DATA
gomathisankariv2
Ā 
Pressure Measurement training for engineers and Technicians
AIESOLUTIONS
Ā 
Submit Your Papers-International Journal on Cybernetics & Informatics ( IJCI)
IJCI JOURNAL
Ā 
AI TECHNIQUES FOR IDENTIFYING ALTERATIONS IN THE HUMAN GUT MICROBIOME IN MULT...
vidyalalltv1
Ā 
methodology-driven-mbse-murphy-july-hsv-huntsville6680038572db67488e78ff00003...
henriqueltorres1
Ā 
fatigue in aircraft structures-221113192308-0ad6dc8c.pptx
aviatecofficial
Ā 
GitOps_Without_K8s_Training_detailed git repository
DanialHabibi2
Ā 
Basic_Concepts_in_Clinical_Biochemistry_2018ŁƒŁŠŁ…ŁŠŲ§Ų”_Ų¹Ł…Ł„ŁŠ.pdf
AdelLoin
Ā 
Worm gear strength and wear calculation as per standard VB Bhandari Databook.
shahveer210504
Ā 
Electrical Machines and Their Protection.pdf
Nabajyoti Banik
Ā 
SERVERLESS PERSONAL TO-DO LIST APPLICATION
anushaashraf20
Ā 
AN EMPIRICAL STUDY ON THE USAGE OF SOCIAL MEDIA IN GERMAN B2C-ONLINE STORES
ijait
Ā 
Knowledge Representation : Semantic Networks
Amity University, Patna
Ā 
MODULE-5 notes [BCG402-CG&V] PART-B.pdf
Alvas Institute of Engineering and technology, Moodabidri
Ā 
Halide Perovskites’ Multifunctional Properties: Coordination Engineering, Coo...
TaameBerhe2
Ā 

Database Design and Normalization Techniques

  • 2. Determinant and Dependent • The expression X → Y means 'if I know the value of X, then I can obtain the value of Y' (in a table or somewhere). • In the expression X → Y, X is the determinant and Y is the dependent attribute. • The value X determines the value of Y. • The value Y depends on the value of X.
  • 3. Functional Dependencies (FD) • An attribute is functionally dependent if its value is determined by another attribute which is a key. • That is, if we know the value of one (or several) data items, then we can find the value of another (or several). • Functional dependencies are expressed as X → Y, where X is the determinant and Y is the functionally dependent attribute. • If A →(B,C) then A → B and A → C. • If (A,B) → C, then it is not necessarily true that A → C and B → C. • If A → B and B → A, then A and B are in a 1-1 relationship. • If A → B then for A there can only ever be one value for B.
  • 4. … • Functional dependency is a relationship that exists when one attribute uniquely determines another attribute. • If R is a relation with attributes X and Y, a functional dependency between the attributes is represented as X->Y, which specifies Y is functionally dependent on X. Here X is a determinant set and Y is a dependent attribute. Each value of X is associated precisely with one Y value. • Functional dependency in a database serves as a constraint between two sets of attributes. Defining functional dependency is an important part of relational database design and contributes to aspect normalization. Example: In a table with attributes of employee name and Social Security number (SSN), employee name is functionally dependent on SSN because the SSN is unique for individual names. An SSN identifies the employee specifically, but an employee name cannot distinguish the SSN because more than one employee could have the same name.
  • 5. Transitive Dependencies (TD) • An attribute is transitively dependent if its value is determined by another attribute which is not a key. • If X → Y and X is not a key then this is a transitive dependency. • A transitive dependency exists when A → B → C but NOT A → C.
  • 6. Multi-Valued Dependencies (MVD) • A table involves a multi-valued dependency if it may contain multiple values for an entity. • X→Y, i.e. X multi-determines Y, when for each value of X we can have more than one value of Y. • If A→B and A→C then we have a single attribute A which multi-determines two other independent attributes, B and C. • If A→(B,C) then we have an attribute A which multi-determines a set of associated attributes, B and C.
  • 7. Why Normalization: Redundancy Roll No. Name Age Branch Branch ID 1 Anmol 24 CSE 101 2 Ansh 23 CSE 101 3 Akshay 25 CSE 101 4 Bhuvnesh 26 CSE 101
  • 8. Anomalies of Database Update anomalies āˆ’ If data items are scattered and are not linked to each other properly, then it could lead to strange situations. For example, when we try to update one data item having its copies scattered over several places, a few instances get updated properly while a few others are left with old values. Such instances leave the database in an inconsistent state. In the above example if the branch code 101 is updated to 102, in that case we need to update all the rows. Deletion anomalies āˆ’ We tried to delete a record, but parts of it was left undeleted because of unawareness, the data is also saved somewhere else. In the above slide example, when we delete all the record of students automatically the data of branch name and branch id is getting deleted, which is not required to delete. We are deleting student information because of which branch information is also being deleted. Insert anomalies āˆ’ We tried to insert data in a record that does not exist at all.
  • 9. Normalization Normalization is a method to remove all these anomalies and bring the database to a consistent state or we can say it is the process to remove redundancy. It contains 4 ways to resolve anomalies using 4 normal forms. 1. First Normal Form 2. Second Normal Form 3. Third Normal Form 4. Boyce-Codd Normal Form
  • 10. First Normal Form First Normal Form is defined in the definition of relations (tables) itself. This rule defines that all the attributes in a relation must have atomic domains. The values in an atomic domain are indivisible units. We re-arrange the relation (table), to convert it to First Normal Form. Before Normalization After Normalization
  • 11. Second Normal Form If we follow second normal form, then every non-prime attribute should be fully functionally dependent on prime key attribute. That is, if X → A holds, then there should not be any proper subset Y of X, for which Y → A also holds true. Prime Key Attributes: Stud_ID, Proj_ID Non Key Attributes: Stu_Name, Proj_Name As per rule: Non-key attributes, i.e. Stu_Name and Proj_Name must be dependent upon both and not on any of the prime key attribute individually. But we find that Stu_Name can be identified by Stu_ID and Proj_Name can be identified by Proj_ID independently. This is called partial dependency, which is not allowed in Second Normal Form.
  • 13. Third Normal Form For a relation to be in Third Normal Form, and the following must satisfy āˆ’ • It must be in Second Normal form • No non-prime attribute is transitively dependent on prime key attribute. • Every non-prime attribute of R is non-transitively dependent on every key of R. We find that in the above Student_detail relation, Stu_ID is the key and only prime key attribute. We find that City can be identified by Stu_ID as well as Zip itself. Neither Zip is a superkey nor is City a prime attribute. Additionally, Stu_ID → Zip → City, so there exists transitive dependency.
  • 15. Boyce-Codd Normal Form Boyce-Codd Normal Form (BCNF) is an extension of Third Normal Form on strict terms. BCNF states that āˆ’ For any non-trivial functional dependency, X → A, X must be a super-key. In the above image, Stu_ID is the super-key in the relation Student_Detail and Zip is the super- key to the relation ZipCodes. So, Stu_ID → Stu_Name, Zip and Zip → City Which confirms that both the relations are in BCNF.
  • 16. Loss-less join Decomposition • Decomposition – the process of breaking down in parts or elements. • Decomposition in database means breaking tables down into multiple tables From Database perspective means going to a higher normal form. • Important that decompositions are ā€œgoodā€, • Two Characteristics of Good Decompositions 1) Lossless: Means functioning without a loss. In other words, retain everything after being break in two or more tables. 2) Preserve dependencies
  • 17. Lossless Decomposition Sometimes the same set of data is reproduced: (Word, 100) + (Word, WP)  (Word, 100, WP) (Oracle, 1000) + (Oracle, DB)  (Oracle, 1000, DB) (Access, 100) + (Access, DB)  (Access, 100, DB) Name Price Category Word 100 WP Oracle 1000 DB Access 100 DB Name Price Word 100 Oracle 1000 Access 100 Name Category Word WP Oracle DB Access DB
  • 18. Lossy Decomposition Sometimes it’s not: (Word, WP) + (100, WP) = (Word, 100, WP) (Oracle, DB) + (1000, DB) = (Oracle, 1000, DB) (Oracle, DB) + (100, DB) = (Oracle, 100, DB) (Access, DB) + (1000, DB) = (Access, 1000, DB) (Access, DB) + (100, DB) = (Access, 100, DB) Name Price Category Word 100 WP Oracle 1000 DB Access 100 DB Category Name WP Word DB Oracle DB Access Category Price WP 100 DB 1000 DB 100 What’s wrong?
  • 19. Column Name Data Type supplierID(primary key) Int suppliername varchar(20) products varchar(20) SupplierID Supplier Name Products 1 Yeki Inc. tshirt, shirt, jeans Column Name Data Type supplierID(primary key) Int suppliername varchar(20) Column Name Data Type Productid Int Productname varchar(20) Supplierid Int Suppliers Suppliers Products
  • 20. Column Name Data Type Productid Int Productname varchar(20) StoreName Varchar(20) Price int Products ProductID ProductName StoreName Price 1 Blue Shirt Store1 2000 2 White Shirt Store2 2300 3 Grey Shirt Store5 2200 4 Blue Shirt Store4 2000 Column Name Data Type Productid Int Productname varchar(20) Price int Column Name Data Type Storeid Int StoreName varchar(20) ProductName Varchar(20) Products Stores 1. There should not be any partial key dependencies. Attribute must be depended upon key. 2. Another principle is there should not be no derived data or calculated fields, such as total, while you have price and quantity in the table. Here product is dependent on store but the attributes don’t have to be depend only on key, so product name in this case does depend on store, but it doesn’t only depend on store for its existence.
  • 21. Column Name Data Type Productid Int Productname varchar(20) Price int Column Name Data Type Storeid Int StoreName varchar(20) Column Name Data Type Storeid Int Productid varchar(20) Products Stores Inventory Attribute must be solely dependent upon the key. Third normal form essentially removes the transitive dependency.
  • 22. BCNF StudentID Name Course Duration 1 Tom Java 60 2 Jerry Database 90 3 Duck Database Adv 100 4 Donalds Database 100