SlideShare a Scribd company logo
1 of 40
Normalization
by Ms. Amrit Kaur
Normalisation by Ms.Amrit Kaur 1
Source: Google Images
 Proposed By E.F. Codd
 Normalization
 tool to validate and improve logical design
 Process of decomposing relation with anomalies and
produces smaller, well structured relation.
What is it?
Normalisation by Ms.Amrit Kaur 2
 Organize the attributes (columns) and tables
(relation) of relational database to
 reduce Data redundancy
 improve Data Integrity
 No data inconsistency
 Decide which attributes should be group together
in a table to create an accurate representation of
data, its relationship and constraint
Objective
Normalisation by Ms.Amrit Kaur 3
Process of Normalization
Normalisation by Ms.Amrit Kaur 4
 Normalization is executed as series of steps. Each
step correspond to specific normal form.
 Normal form is a state of relation(table) generated
by applying rules regarding relationship between
attributes to that relation.
Process
Normalisation by Ms.Amrit Kaur 5
Process
Normalisation by Ms.Amrit Kaur 6
First step of Normalization
First normal form
Normalisation by Ms.Amrit Kaur 7
 First Normal Form
 RULE: A relation is said to be in First Normal Form if each
cell contains one and only one value.
 Converting Unnormalized relation to 1 NF
 Enter data into empty columns of rows
 Create separate row for multivalued column
1NF
Normalisation by Ms.Amrit Kaur 8
CustNo CustName ProdNo ProdName Price Qty OrderDate
????
C101
John P001 Pen 10 100 10.Oct.2020
John P002 Pencil 3 200 11.Oct.2020
????
????
C102
Pat P001 Pen 10 130 10.Oct.2020
Pat P1004 Eraser 5 150 12.Oct.2020
Pat P006 Ruler 7 200 11.Oct.2020
Unnormalised Table
Normalisation by Ms.Amrit Kaur 9
CustNo CustName ProdNo ProdName Price Qty OrderDate
C101
C101
John
?????
P001
P002
Pen
Pencil
10
3
100
200
10.Oct.2020
????
C102
Pat P001 Pen 10 130 10.Oct.2020
Pat P1004 Eraser 5 150 12.Oct.2020
Pat P006 Ruler 7 200 11.Oct.2020
CustNo CustName ProdNo ProdName Price Qty OrderDate
C101 John P001 Pen 10 100 10.Oct.2020
C101 John P002 Pencil 3 20
0
11.Oct.2020
C102 Pat P001 Pen 10 130 10.Oct.2020
C102 Pat P1004 Eraser 5 150 12.Oct.2020
C102 Pat P006 Ruler 7 200 11.Oct.2020
Table in 1NF
Normalisation by Ms.Amrit Kaur 10
Second Normal Form
Normalisation by Ms.Amrit Kaur 11
 Second Normal Form
 RULE: A relation is in 2NF if and only if it is in 1NF and
every non key attributes are FULLY functionally
dependent on primary key.
 Procedure: Converting from 1NF to 2NF
 Identify functional dependencies
 Identify primary key
 Identify partial dependencies on primary key,
 If partial dependencies exist, remove it from 1NF relation by
placing them in new relation along with copy of determinant.
2NF
Normalisation by Ms.Amrit Kaur 12
Functional
Dependencies
Normalisation by Ms.Amrit Kaur 13
 Functional Dependencies defines relation between
attributes(columns) in a relation(table).
 Given a relation R, a set of attributes X in R is said
to be functionally dependent on another set of
attribute Y if and only if, for each one X value in R is
associated with precisely one Y value in R.
What is it?
Normalisation by Ms.Amrit Kaur 14
 Y(attribute) functionally dependent on X(attribute)
 It is denoted by X->Y
 The attribute on left hand side of arrow is called
determinant.
 The attribute on right side of arrow is called dependent.
How is it represented?
Normalisation by Ms.Amrit Kaur 15
 Partial Functional Dependencies
 A functional dependency in which one or more non key
attributes are functionally dependent on part of primary key.
 Fully Functional Dependencies
 A functional dependency in which one or more non key
attributes are totally depending functionally dependent on
primary key.
Transitivity Dependencies
Types of Functional Dependencies
Normalisation by Ms.Amrit Kaur 16
Example:
Converting 1 NF Table to
2NF
Normalisation by Ms.Amrit Kaur 17
CourseNo DepartmentName CourseName Room Enrollment
4604 CS Database 201 45
4604 Dance Tree Dancing 302 45
4604 English The Basics of Data 123 45
2604 CS Data Structure 456 100
2604 Physics Dark Matter 302 100
Step 1 ….Identify FD
Normalisation by Ms.Amrit Kaur 18
Relation (Functional Dependency between CourseNo(X) and DepartmentName(Y)
For each X values(CourseNo) 4604 – How many departmentName ???? … 3 (CS,Dance,
English)….all are different…. 3 Y values (DepartmentName) .
Hence, CourseNo and DepartmentName not functionally dependent
Relation (Functional Dependency between CourseNo(X) and CourseName(Y)
For each X values(CourseNo) 4604 – How many courseName ?? … 3 different
courseName. It means 3 Y values (DepartmentName) .
Hence, CourseNo and CourseName not functionally dependent
CourseNo DepartmentName CourseName Room Enrollment
4604 CS Database 201 45
4604 Dance Tree Dancing 302 45
4604 English The Basics of Data 123 45
2604 CS Data Structure 456 100
2604 Physics Dark Matter 302 100
[contd.] Step 1
Normalisation by Ms.Amrit Kaur 19
Relation (Functional Dependency between CourseNo(X) and Room(Y)
For each X values(CourseNo) 4604 –3 different rooms; i.e. 3 Y values .
Hence, CourseNo and Room not functionally dependent
Relation (Functional Dependency between CourseNo(X) and EnrollmentY)
For each X values(CourseNo) 4604 – How many enrollment?? … 3 but value is 1; i.e.
45. It means 1 Y Value
Hence, CourseNo and Enrollment are functionally dependent. CourseNo ->Enrollment
 Identified Functional Dependencies considering each
attributes individually and then attribute combinations
1. CourseNo -> Enrollment
2. CourseName -> Room
3. CourseName->Enrollment
4. CourseNo+DepartmentName -> CourseName
5. CoursrNo+DepartmentName -> Room
6. CourseNo+ Department -> Enrollment
7. CourseName+DepartmentName -> CourseNo
8. CoursrName+DepartmentName -> Room
9. CourseName+ Department -> Enrollment
[contd] Step 1
Normalisation by Ms.Amrit Kaur 20
 Make list of Determinants from identified FDs
 Rules of Choosing Primary Key
 Dependent cannot be primary key
 For Determinant, the column must not contain duplicate
values
Step 2 ….Choose Primary Key
Normalisation by Ms.Amrit Kaur 21
 List of Determinants
(left hand side of FDs)
 CourseNo
 CourseName
 CourseNo+DepartmentName
 CourseName+ DepartmentName
 Identified functional dependencies in Step 1
[contd.] Step 2
Normalisation by Ms.Amrit Kaur 22
• Apply Rules
– In FD (4), CourseName is dependent
– In FD (7), CourseNo is dependent
Both Cannot be Primary Key
1. CourseNo -> Enrollment 2. CourseName -> Room
3. CourseName->Enrollment 4. CourseNo+DepartmentName -> CourseName
5.CoursrNo+DepartmentName -> Room 6.CourseNo+ Department -> Enrollment
7.CourseName+DepartmentName -> CourseNo 8. CoursrName+DepartmentName -> Room
9. CourseName+ Department -> Enrollment
• Choose any ONE as Primary Key
– CourseNo + DepartmentName
– CourseName + DepartmentName
Partial Dependency means
 one or more non key
attributes are functionally
dependent on part of primary
key.
 Identified functional dependencies in Step 1
Step 3…. Identify Partial Dependencies
Normalisation by Ms.Amrit Kaur 23
DepartmentName->Enrollment (FALSE)
It means from FD(1), Enrollment is depending
on primary key as a whole and also ONLY on
CourseNo (part of primary Key) .
1. CourseNo -> Enrollment 2. CourseName -> Room
3. CourseName->Enrollment 4. CourseNo+DepartmentName -> CourseName
5.CoursrNo+DepartmentName -> Room 6.CourseNo+ Department -> Enrollment
7.CourseName+DepartmentName -> CourseNo 8. CoursrName+DepartmentName -> Room
9. CourseName+ Department -> Enrollment
• Identified PRIMARY KEY in Step2 CourseNo + DepartmentName
• Partial Dependencies Exist
CourseNo - Enrollment
 Remove partial dependencies Enrollment from Table in 1 NF
 Create separate table with Enrollment
 Copy determinants CourseNo also
Step 4 ….Remove Partial
Dependencies
Normalisation by Ms.Amrit Kaur 24
Course
No
DepartmentName CourseName Room
4604 CS Database 201
4604 Dance Tree Dancing 302
4604 English The Basics of Data 123
2604 CS Data Structure 456
2604 Physics Dark Matter 302
CourseNo Enrollment
4604 45
2604 100
After 2NF, Table Structure
CustNo CustName ProdNo ProdName Price Qty Order
No
OrderDate
C101 John P001 Pen 10 100 1 10.Oct.2020
C101 John P002 Pencil 3 200 2 11.Oct.2020
C102 Pat P001 Pen 10 130 3 10.Oct.2020
C102 Pat P1004 Eraser 5 150 4 12.Oct.2020
C102 Pat P006 Ruler 7 200 5 11.Oct.2020
Example 2. Convert Table to 2NF
Normalisation by Ms.Amrit Kaur 25
Step1: Identify Functional Dependency
(CustNo+ProdNo)->Qty
(CustNo+ProdNo)->ProdName
(CustNo+ProdNo)-> Price
(CustNo+ProdNo)->OrderNo
(CustNo+ProdNo)->OrderDate
Step2: Identify Primary Key
(CustNo+ProdNo)
Step3: Partial Dependency
(CustomerName is depending only on CustNo,
not on ProdNo
CustNo->Custname
(ProductName is depending only on ProdNo
not on CustNo
Prodno->ProdName
STEP 4. Remove dependencies CustName and ProdName from Table in 1 NF and create
two separate tables and copy determinants CustNo and ProdNo respectively.
Example 2. After 2 NF
Normalisation by Ms.Amrit Kaur 26
CustNo CustName
C101 John
C102 Pat
CustNo ProdNo Price Qty OrderNo OrderDate
C101 P001 10 100 1 10.Oct.2020
C101 P002 3 200 2 11.Oct.2020
C102 P001 10 130 3 10.Oct.2020
C102 P1004 5 150 4 12.Oct.2020
C102 P006 7 200 5 11.Oct.2020
ProdNo ProdName
P001 Pen
P002 Pencil
P1004 Eraser
P006 Ruler
Customer Product
Purchase
Third Normal Form
Normalisation by Ms.Amrit Kaur 27
 Third Normal Form
 RULE: A relation is in 3NF if and only if it is in
2NF and every nonkey attribute is non
transitively dependent on primary key.
 Procedure: Converting 2NF to 3NF
 Identify Functional Dependencies
 Identify primary key
 If transitive dependency exist on primary key, remove them
by placing them in new relation along with dominant.
3NF
Normalisation by Ms.Amrit Kaur 28
 A transitive dependency exists when the following
functional dependency pattern:
 A → B
 B → C ; therefore A → C.
 If any attribute is depending upon primary key and also
depending upon other attribute
What is Transitive Dependency?
Normalisation by Ms.Amrit Kaur 29
Example:
Converting 2NF Table to
3NF
Normalisation by Ms.Amrit Kaur 30
2 NF Tables
Normalisation by Ms.Amrit Kaur 31
CustNo CustName
C101 John
C101 John
C102 Pat
C102 Pat
C102 Pat
CustNo ProdNo Price Qty OrderNo OrderDate
C101 P001 10 100 1 10.Oct.2020
C101 P002 3 200 2 11.Oct.2020
C102 P001 10 130 3 10.Oct.2020
C102 P1004 5 150 4 12.Oct.2020
C102 P006 7 200 5 11.Oct.2020
ProdNo ProdName
P001 Pen
P002 Pencil
P001 Pen
P1004 Eraser
P006 Ruler
Customer Product
Purchase
Steps…Converting 2NF to 3NF
Normalisation by Ms.Amrit Kaur 32
Step1: Identify Functional Dependency
Customer Relation
1. CustNo -> CustName
Product Relation
2. ProdNo -> ProdName
Purchase Relation
3. (CustNo+ProdNo)->Qty
4. (CustNo+ProdNo)-> Price
5. (CustNo+ProdNo)->OrderNo
6. (CustNo+ProdNo)->OrderDate
7. OrderNo -> OrderDate
Step2: Identify Primary Key
Customer Relation – CustNo
Product Relation – ProdNo
Purchase – CustNo+ ProdNO
Step3: Transitive Dependency
Non key attribute is depending upon other
attribute that is not primary key then
transitive dependencies exist. Here
(CustNo+ProdNo)->OrderNo
OrderNo -> OrderDate
(CustNo+ProdNo)->OrderDate
STEP 4. Remove transitive
dependencies OrderDate from Table in
2 NF and create separate tables and
copy OrderNo
After 3 NF
Normalisation by Ms.Amrit Kaur 33
CustNo CustName
C101 John
C101 John
C102 Pat
C102 Pat
C102 Pat
CustNo ProdNo Price Qty OrderNo
C101 P001 10 100 1
C101 P002 3 200 2
C102 P001 10 130 3
C102 P1004 5 150 4
C102 P006 7 200 5
ProdNo ProdName
P001 Pen
P002 Pencil
P001 Pen
P1004 Eraser
P006 Ruler
Customer Product
Purchase
OrderNo OrderDate
1 10.Oct.2020
2 11.Oct.2020
3 10.Oct.2020
4 12.Oct.2020
5 11.Oct.2020
Order
Boyce Codd Normal Form(BCNF)
Normalisation by Ms.Amrit Kaur 34
 Relations in 3NF still contain redundancy when
 There are two or more candidate key
 Candidate Keys are composite key
 Candidate Key overlaps (one attribute common)
 BCNF
 RULE: A relation is in BCNF if and only if every
determinant is a candidate key
BCNF
Normalisation by Ms.Amrit Kaur 35
 Procedure: Converting to BCNF
 Identify all candidate keys
 Indentify all functional dependencies
 If functional dependencies exist where determinants are
not candidate key, remove functional dependencies by
placing them in new relation along with determinant
BCNF
Normalisation by Ms.Amrit Kaur 36
Example: Apply BCNF
Normalisation by Ms.Amrit Kaur 37
ClientNo InterviewDate Interview Time Staff No Room No
C176 20-Oct-2020 10:30 S5 101
C156 20-Oct-2020 12:00 S5 101
C174 20-Oct-2020 12:00 S37 102
C156 22-Oct-2020 10:30 S5 102
Primary Key (ClientNo,InterviewDate)->(InterviewTime,StaffNo,RoomNo)
Candidate Keys
1. (StaffNo,InterviewDat,InterviewTime) -> (ClientNo, RoomNo)
2. (RoomNo,InterviewDate,InterviewTime)-> (StaffNo, ClientNo)
Other Functional Dependency – Determinant not Candidate Key
Remove and create another relation and copy determinant
1. (StaffNo, InterviewDate) -> RoomNo
After BCNF
Normalisation by Ms.Amrit Kaur 38
ClientNo InterviewDate Interview Time Staff No
C176 20-Oct-2020 10:30 S5
C156 20-Oct-2020 12:00 S5
C174 20-Oct-2020 12:00 S37
C156 22-Oct-2020 10:30 S5
Staff No InterviewDate Room No
S5 20-Oct-2020 101
S37 20-Oct-2020 101
S5 22-Oct-2020 102
Questions
Normalisation by Ms.Amrit Kaur 39
Thank You
Normalisation by Ms.Amrit Kaur 40

More Related Content

What's hot

Functional dependencies and normalization
Functional dependencies and normalizationFunctional dependencies and normalization
Functional dependencies and normalizationdaxesh chauhan
 
Relational Algebra
Relational AlgebraRelational Algebra
Relational AlgebraAmin Omi
 
Entity relationship diagram - Concept on normalization
Entity relationship diagram - Concept on normalizationEntity relationship diagram - Concept on normalization
Entity relationship diagram - Concept on normalizationSatya Pal
 
Database Normalization
Database NormalizationDatabase Normalization
Database NormalizationArun Sharma
 
Database Concept - Normalization (1NF, 2NF, 3NF)
Database Concept - Normalization (1NF, 2NF, 3NF)Database Concept - Normalization (1NF, 2NF, 3NF)
Database Concept - Normalization (1NF, 2NF, 3NF)Oum Saokosal
 
Normalization | (1NF) |(2NF) (3NF)|BCNF| 4NF |5NF
Normalization | (1NF) |(2NF) (3NF)|BCNF| 4NF |5NFNormalization | (1NF) |(2NF) (3NF)|BCNF| 4NF |5NF
Normalization | (1NF) |(2NF) (3NF)|BCNF| 4NF |5NFBiplap Bhattarai
 
Data Modeling Using the EntityRelationship (ER) Model
Data Modeling Using the EntityRelationship (ER) ModelData Modeling Using the EntityRelationship (ER) Model
Data Modeling Using the EntityRelationship (ER) Modelsontumax
 
Learn Normalization in simple language
Learn Normalization in simple languageLearn Normalization in simple language
Learn Normalization in simple languageFirstWire Apps
 
Types Of Keys in DBMS
Types Of Keys in DBMSTypes Of Keys in DBMS
Types Of Keys in DBMSPadamNepal1
 
Normalization
NormalizationNormalization
Normalizationmomo2187
 
Major and Minor Elements of Object Model
Major and Minor Elements of Object ModelMajor and Minor Elements of Object Model
Major and Minor Elements of Object Modelsohailsaif
 
FUNCTION DEPENDENCY AND TYPES & EXAMPLE
FUNCTION DEPENDENCY  AND TYPES & EXAMPLEFUNCTION DEPENDENCY  AND TYPES & EXAMPLE
FUNCTION DEPENDENCY AND TYPES & EXAMPLEVraj Patel
 
Decomposition using Functional Dependency
Decomposition using Functional DependencyDecomposition using Functional Dependency
Decomposition using Functional DependencyRaj Naik
 

What's hot (20)

Functional dependencies and normalization
Functional dependencies and normalizationFunctional dependencies and normalization
Functional dependencies and normalization
 
Relational Algebra
Relational AlgebraRelational Algebra
Relational Algebra
 
Entity relationship diagram - Concept on normalization
Entity relationship diagram - Concept on normalizationEntity relationship diagram - Concept on normalization
Entity relationship diagram - Concept on normalization
 
Database Normalization
Database NormalizationDatabase Normalization
Database Normalization
 
Database Concept - Normalization (1NF, 2NF, 3NF)
Database Concept - Normalization (1NF, 2NF, 3NF)Database Concept - Normalization (1NF, 2NF, 3NF)
Database Concept - Normalization (1NF, 2NF, 3NF)
 
Normalization | (1NF) |(2NF) (3NF)|BCNF| 4NF |5NF
Normalization | (1NF) |(2NF) (3NF)|BCNF| 4NF |5NFNormalization | (1NF) |(2NF) (3NF)|BCNF| 4NF |5NF
Normalization | (1NF) |(2NF) (3NF)|BCNF| 4NF |5NF
 
Data Modeling Using the EntityRelationship (ER) Model
Data Modeling Using the EntityRelationship (ER) ModelData Modeling Using the EntityRelationship (ER) Model
Data Modeling Using the EntityRelationship (ER) Model
 
Learn Normalization in simple language
Learn Normalization in simple languageLearn Normalization in simple language
Learn Normalization in simple language
 
Types Of Keys in DBMS
Types Of Keys in DBMSTypes Of Keys in DBMS
Types Of Keys in DBMS
 
Normalization
NormalizationNormalization
Normalization
 
Normal forms
Normal formsNormal forms
Normal forms
 
Functional dependency
Functional dependencyFunctional dependency
Functional dependency
 
Relational algebra
Relational algebraRelational algebra
Relational algebra
 
Major and Minor Elements of Object Model
Major and Minor Elements of Object ModelMajor and Minor Elements of Object Model
Major and Minor Elements of Object Model
 
Normalization in DBMS
Normalization in DBMSNormalization in DBMS
Normalization in DBMS
 
FUNCTION DEPENDENCY AND TYPES & EXAMPLE
FUNCTION DEPENDENCY  AND TYPES & EXAMPLEFUNCTION DEPENDENCY  AND TYPES & EXAMPLE
FUNCTION DEPENDENCY AND TYPES & EXAMPLE
 
Decomposition using Functional Dependency
Decomposition using Functional DependencyDecomposition using Functional Dependency
Decomposition using Functional Dependency
 
Lossless decomposition
Lossless decompositionLossless decomposition
Lossless decomposition
 
Normalization
NormalizationNormalization
Normalization
 
CLR AND LALR PARSER
CLR AND LALR PARSERCLR AND LALR PARSER
CLR AND LALR PARSER
 

Similar to Normalization (20)

Normalisation
NormalisationNormalisation
Normalisation
 
Normmmalizzarion.ppt
Normmmalizzarion.pptNormmmalizzarion.ppt
Normmmalizzarion.ppt
 
Normalization.ppt
Normalization.pptNormalization.ppt
Normalization.ppt
 
Chapter5.pptx
Chapter5.pptxChapter5.pptx
Chapter5.pptx
 
Normalization
NormalizationNormalization
Normalization
 
Presentation on Normalization.pptx
Presentation on Normalization.pptxPresentation on Normalization.pptx
Presentation on Normalization.pptx
 
Chapter+3+-+Normalization.pdf
Chapter+3+-+Normalization.pdfChapter+3+-+Normalization.pdf
Chapter+3+-+Normalization.pdf
 
Database management system session 5
Database management system session 5Database management system session 5
Database management system session 5
 
Normalization
NormalizationNormalization
Normalization
 
Penormalan/Normalization
Penormalan/NormalizationPenormalan/Normalization
Penormalan/Normalization
 
Normalization
NormalizationNormalization
Normalization
 
Chapter 2 Relational Data Model-part 3
Chapter 2 Relational Data Model-part 3Chapter 2 Relational Data Model-part 3
Chapter 2 Relational Data Model-part 3
 
Normalization
Normalization Normalization
Normalization
 
Lecture8 Normalization Aggarwal
Lecture8 Normalization AggarwalLecture8 Normalization Aggarwal
Lecture8 Normalization Aggarwal
 
Chapter10
Chapter10Chapter10
Chapter10
 
Chapter 3 ( PART 2 ).pptx
Chapter 3 ( PART 2 ).pptxChapter 3 ( PART 2 ).pptx
Chapter 3 ( PART 2 ).pptx
 
Normalization
NormalizationNormalization
Normalization
 
Database Normalization.ppt
Database Normalization.pptDatabase Normalization.ppt
Database Normalization.ppt
 
normalization.ppt
normalization.pptnormalization.ppt
normalization.ppt
 
normalization-Normalization -Process of Divide Tables
normalization-Normalization -Process of Divide Tablesnormalization-Normalization -Process of Divide Tables
normalization-Normalization -Process of Divide Tables
 

More from Amrit Kaur

File Organization
File OrganizationFile Organization
File OrganizationAmrit Kaur
 
Introduction to transaction processing
Introduction to transaction processingIntroduction to transaction processing
Introduction to transaction processingAmrit Kaur
 
Transaction Processing
Transaction ProcessingTransaction Processing
Transaction ProcessingAmrit Kaur
 
Sample Interview Question
Sample Interview QuestionSample Interview Question
Sample Interview QuestionAmrit Kaur
 
12. oracle database architecture
12. oracle database architecture12. oracle database architecture
12. oracle database architectureAmrit Kaur
 
11. using regular expressions with oracle database
11. using regular expressions with oracle database11. using regular expressions with oracle database
11. using regular expressions with oracle databaseAmrit Kaur
 
9. index and index organized table
9. index and index organized table9. index and index organized table
9. index and index organized tableAmrit Kaur
 
8. transactions
8. transactions8. transactions
8. transactionsAmrit Kaur
 
7. exceptions handling in pl
7. exceptions handling in pl7. exceptions handling in pl
7. exceptions handling in plAmrit Kaur
 
5. stored procedure and functions
5. stored procedure and functions5. stored procedure and functions
5. stored procedure and functionsAmrit Kaur
 
2. DML_INSERT_DELETE_UPDATE
2. DML_INSERT_DELETE_UPDATE2. DML_INSERT_DELETE_UPDATE
2. DML_INSERT_DELETE_UPDATEAmrit Kaur
 
1. dml select statement reterive data
1. dml select statement reterive data1. dml select statement reterive data
1. dml select statement reterive dataAmrit Kaur
 
Chapter 8 Inheritance
Chapter 8 InheritanceChapter 8 Inheritance
Chapter 8 InheritanceAmrit Kaur
 
Chapter 7 C++ As OOP
Chapter 7 C++ As OOPChapter 7 C++ As OOP
Chapter 7 C++ As OOPAmrit Kaur
 
Chapter 6 OOPS Concept
Chapter 6 OOPS ConceptChapter 6 OOPS Concept
Chapter 6 OOPS ConceptAmrit Kaur
 

More from Amrit Kaur (20)

File Organization
File OrganizationFile Organization
File Organization
 
Introduction to transaction processing
Introduction to transaction processingIntroduction to transaction processing
Introduction to transaction processing
 
ER diagram
ER diagramER diagram
ER diagram
 
Transaction Processing
Transaction ProcessingTransaction Processing
Transaction Processing
 
Sample Interview Question
Sample Interview QuestionSample Interview Question
Sample Interview Question
 
12. oracle database architecture
12. oracle database architecture12. oracle database architecture
12. oracle database architecture
 
11. using regular expressions with oracle database
11. using regular expressions with oracle database11. using regular expressions with oracle database
11. using regular expressions with oracle database
 
10. timestamp
10. timestamp10. timestamp
10. timestamp
 
9. index and index organized table
9. index and index organized table9. index and index organized table
9. index and index organized table
 
8. transactions
8. transactions8. transactions
8. transactions
 
7. exceptions handling in pl
7. exceptions handling in pl7. exceptions handling in pl
7. exceptions handling in pl
 
6. triggers
6. triggers6. triggers
6. triggers
 
5. stored procedure and functions
5. stored procedure and functions5. stored procedure and functions
5. stored procedure and functions
 
4. plsql
4. plsql4. plsql
4. plsql
 
3. ddl create
3. ddl create3. ddl create
3. ddl create
 
2. DML_INSERT_DELETE_UPDATE
2. DML_INSERT_DELETE_UPDATE2. DML_INSERT_DELETE_UPDATE
2. DML_INSERT_DELETE_UPDATE
 
1. dml select statement reterive data
1. dml select statement reterive data1. dml select statement reterive data
1. dml select statement reterive data
 
Chapter 8 Inheritance
Chapter 8 InheritanceChapter 8 Inheritance
Chapter 8 Inheritance
 
Chapter 7 C++ As OOP
Chapter 7 C++ As OOPChapter 7 C++ As OOP
Chapter 7 C++ As OOP
 
Chapter 6 OOPS Concept
Chapter 6 OOPS ConceptChapter 6 OOPS Concept
Chapter 6 OOPS Concept
 

Recently uploaded

POINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptx
POINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptxPOINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptx
POINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptxSayali Powar
 
Final demo Grade 9 for demo Plan dessert.pptx
Final demo Grade 9 for demo Plan dessert.pptxFinal demo Grade 9 for demo Plan dessert.pptx
Final demo Grade 9 for demo Plan dessert.pptxAvyJaneVismanos
 
How to Configure Email Server in Odoo 17
How to Configure Email Server in Odoo 17How to Configure Email Server in Odoo 17
How to Configure Email Server in Odoo 17Celine George
 
History Class XII Ch. 3 Kinship, Caste and Class (1).pptx
History Class XII Ch. 3 Kinship, Caste and Class (1).pptxHistory Class XII Ch. 3 Kinship, Caste and Class (1).pptx
History Class XII Ch. 3 Kinship, Caste and Class (1).pptxsocialsciencegdgrohi
 
Enzyme, Pharmaceutical Aids, Miscellaneous Last Part of Chapter no 5th.pdf
Enzyme, Pharmaceutical Aids, Miscellaneous Last Part of Chapter no 5th.pdfEnzyme, Pharmaceutical Aids, Miscellaneous Last Part of Chapter no 5th.pdf
Enzyme, Pharmaceutical Aids, Miscellaneous Last Part of Chapter no 5th.pdfSumit Tiwari
 
A Critique of the Proposed National Education Policy Reform
A Critique of the Proposed National Education Policy ReformA Critique of the Proposed National Education Policy Reform
A Critique of the Proposed National Education Policy ReformChameera Dedduwage
 
“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...
“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...
“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...Marc Dusseiller Dusjagr
 
How to Make a Pirate ship Primary Education.pptx
How to Make a Pirate ship Primary Education.pptxHow to Make a Pirate ship Primary Education.pptx
How to Make a Pirate ship Primary Education.pptxmanuelaromero2013
 
Presiding Officer Training module 2024 lok sabha elections
Presiding Officer Training module 2024 lok sabha electionsPresiding Officer Training module 2024 lok sabha elections
Presiding Officer Training module 2024 lok sabha electionsanshu789521
 
Painted Grey Ware.pptx, PGW Culture of India
Painted Grey Ware.pptx, PGW Culture of IndiaPainted Grey Ware.pptx, PGW Culture of India
Painted Grey Ware.pptx, PGW Culture of IndiaVirag Sontakke
 
भारत-रोम व्यापार.pptx, Indo-Roman Trade,
भारत-रोम व्यापार.pptx, Indo-Roman Trade,भारत-रोम व्यापार.pptx, Indo-Roman Trade,
भारत-रोम व्यापार.pptx, Indo-Roman Trade,Virag Sontakke
 
Organic Name Reactions for the students and aspirants of Chemistry12th.pptx
Organic Name Reactions  for the students and aspirants of Chemistry12th.pptxOrganic Name Reactions  for the students and aspirants of Chemistry12th.pptx
Organic Name Reactions for the students and aspirants of Chemistry12th.pptxVS Mahajan Coaching Centre
 
Paris 2024 Olympic Geographies - an activity
Paris 2024 Olympic Geographies - an activityParis 2024 Olympic Geographies - an activity
Paris 2024 Olympic Geographies - an activityGeoBlogs
 
18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdf
18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdf18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdf
18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdfssuser54595a
 
Biting mechanism of poisonous snakes.pdf
Biting mechanism of poisonous snakes.pdfBiting mechanism of poisonous snakes.pdf
Biting mechanism of poisonous snakes.pdfadityarao40181
 
Computed Fields and api Depends in the Odoo 17
Computed Fields and api Depends in the Odoo 17Computed Fields and api Depends in the Odoo 17
Computed Fields and api Depends in the Odoo 17Celine George
 
The Most Excellent Way | 1 Corinthians 13
The Most Excellent Way | 1 Corinthians 13The Most Excellent Way | 1 Corinthians 13
The Most Excellent Way | 1 Corinthians 13Steve Thomason
 
Science lesson Moon for 4th quarter lesson
Science lesson Moon for 4th quarter lessonScience lesson Moon for 4th quarter lesson
Science lesson Moon for 4th quarter lessonJericReyAuditor
 

Recently uploaded (20)

POINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptx
POINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptxPOINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptx
POINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptx
 
Final demo Grade 9 for demo Plan dessert.pptx
Final demo Grade 9 for demo Plan dessert.pptxFinal demo Grade 9 for demo Plan dessert.pptx
Final demo Grade 9 for demo Plan dessert.pptx
 
How to Configure Email Server in Odoo 17
How to Configure Email Server in Odoo 17How to Configure Email Server in Odoo 17
How to Configure Email Server in Odoo 17
 
History Class XII Ch. 3 Kinship, Caste and Class (1).pptx
History Class XII Ch. 3 Kinship, Caste and Class (1).pptxHistory Class XII Ch. 3 Kinship, Caste and Class (1).pptx
History Class XII Ch. 3 Kinship, Caste and Class (1).pptx
 
Enzyme, Pharmaceutical Aids, Miscellaneous Last Part of Chapter no 5th.pdf
Enzyme, Pharmaceutical Aids, Miscellaneous Last Part of Chapter no 5th.pdfEnzyme, Pharmaceutical Aids, Miscellaneous Last Part of Chapter no 5th.pdf
Enzyme, Pharmaceutical Aids, Miscellaneous Last Part of Chapter no 5th.pdf
 
A Critique of the Proposed National Education Policy Reform
A Critique of the Proposed National Education Policy ReformA Critique of the Proposed National Education Policy Reform
A Critique of the Proposed National Education Policy Reform
 
“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...
“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...
“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...
 
How to Make a Pirate ship Primary Education.pptx
How to Make a Pirate ship Primary Education.pptxHow to Make a Pirate ship Primary Education.pptx
How to Make a Pirate ship Primary Education.pptx
 
Presiding Officer Training module 2024 lok sabha elections
Presiding Officer Training module 2024 lok sabha electionsPresiding Officer Training module 2024 lok sabha elections
Presiding Officer Training module 2024 lok sabha elections
 
Painted Grey Ware.pptx, PGW Culture of India
Painted Grey Ware.pptx, PGW Culture of IndiaPainted Grey Ware.pptx, PGW Culture of India
Painted Grey Ware.pptx, PGW Culture of India
 
Model Call Girl in Tilak Nagar Delhi reach out to us at 🔝9953056974🔝
Model Call Girl in Tilak Nagar Delhi reach out to us at 🔝9953056974🔝Model Call Girl in Tilak Nagar Delhi reach out to us at 🔝9953056974🔝
Model Call Girl in Tilak Nagar Delhi reach out to us at 🔝9953056974🔝
 
भारत-रोम व्यापार.pptx, Indo-Roman Trade,
भारत-रोम व्यापार.pptx, Indo-Roman Trade,भारत-रोम व्यापार.pptx, Indo-Roman Trade,
भारत-रोम व्यापार.pptx, Indo-Roman Trade,
 
Organic Name Reactions for the students and aspirants of Chemistry12th.pptx
Organic Name Reactions  for the students and aspirants of Chemistry12th.pptxOrganic Name Reactions  for the students and aspirants of Chemistry12th.pptx
Organic Name Reactions for the students and aspirants of Chemistry12th.pptx
 
Paris 2024 Olympic Geographies - an activity
Paris 2024 Olympic Geographies - an activityParis 2024 Olympic Geographies - an activity
Paris 2024 Olympic Geographies - an activity
 
18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdf
18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdf18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdf
18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdf
 
TataKelola dan KamSiber Kecerdasan Buatan v022.pdf
TataKelola dan KamSiber Kecerdasan Buatan v022.pdfTataKelola dan KamSiber Kecerdasan Buatan v022.pdf
TataKelola dan KamSiber Kecerdasan Buatan v022.pdf
 
Biting mechanism of poisonous snakes.pdf
Biting mechanism of poisonous snakes.pdfBiting mechanism of poisonous snakes.pdf
Biting mechanism of poisonous snakes.pdf
 
Computed Fields and api Depends in the Odoo 17
Computed Fields and api Depends in the Odoo 17Computed Fields and api Depends in the Odoo 17
Computed Fields and api Depends in the Odoo 17
 
The Most Excellent Way | 1 Corinthians 13
The Most Excellent Way | 1 Corinthians 13The Most Excellent Way | 1 Corinthians 13
The Most Excellent Way | 1 Corinthians 13
 
Science lesson Moon for 4th quarter lesson
Science lesson Moon for 4th quarter lessonScience lesson Moon for 4th quarter lesson
Science lesson Moon for 4th quarter lesson
 

Normalization

  • 1. Normalization by Ms. Amrit Kaur Normalisation by Ms.Amrit Kaur 1 Source: Google Images
  • 2.  Proposed By E.F. Codd  Normalization  tool to validate and improve logical design  Process of decomposing relation with anomalies and produces smaller, well structured relation. What is it? Normalisation by Ms.Amrit Kaur 2
  • 3.  Organize the attributes (columns) and tables (relation) of relational database to  reduce Data redundancy  improve Data Integrity  No data inconsistency  Decide which attributes should be group together in a table to create an accurate representation of data, its relationship and constraint Objective Normalisation by Ms.Amrit Kaur 3
  • 5.  Normalization is executed as series of steps. Each step correspond to specific normal form.  Normal form is a state of relation(table) generated by applying rules regarding relationship between attributes to that relation. Process Normalisation by Ms.Amrit Kaur 5
  • 7. First step of Normalization First normal form Normalisation by Ms.Amrit Kaur 7
  • 8.  First Normal Form  RULE: A relation is said to be in First Normal Form if each cell contains one and only one value.  Converting Unnormalized relation to 1 NF  Enter data into empty columns of rows  Create separate row for multivalued column 1NF Normalisation by Ms.Amrit Kaur 8
  • 9. CustNo CustName ProdNo ProdName Price Qty OrderDate ???? C101 John P001 Pen 10 100 10.Oct.2020 John P002 Pencil 3 200 11.Oct.2020 ???? ???? C102 Pat P001 Pen 10 130 10.Oct.2020 Pat P1004 Eraser 5 150 12.Oct.2020 Pat P006 Ruler 7 200 11.Oct.2020 Unnormalised Table Normalisation by Ms.Amrit Kaur 9 CustNo CustName ProdNo ProdName Price Qty OrderDate C101 C101 John ????? P001 P002 Pen Pencil 10 3 100 200 10.Oct.2020 ???? C102 Pat P001 Pen 10 130 10.Oct.2020 Pat P1004 Eraser 5 150 12.Oct.2020 Pat P006 Ruler 7 200 11.Oct.2020
  • 10. CustNo CustName ProdNo ProdName Price Qty OrderDate C101 John P001 Pen 10 100 10.Oct.2020 C101 John P002 Pencil 3 20 0 11.Oct.2020 C102 Pat P001 Pen 10 130 10.Oct.2020 C102 Pat P1004 Eraser 5 150 12.Oct.2020 C102 Pat P006 Ruler 7 200 11.Oct.2020 Table in 1NF Normalisation by Ms.Amrit Kaur 10
  • 11. Second Normal Form Normalisation by Ms.Amrit Kaur 11
  • 12.  Second Normal Form  RULE: A relation is in 2NF if and only if it is in 1NF and every non key attributes are FULLY functionally dependent on primary key.  Procedure: Converting from 1NF to 2NF  Identify functional dependencies  Identify primary key  Identify partial dependencies on primary key,  If partial dependencies exist, remove it from 1NF relation by placing them in new relation along with copy of determinant. 2NF Normalisation by Ms.Amrit Kaur 12
  • 14.  Functional Dependencies defines relation between attributes(columns) in a relation(table).  Given a relation R, a set of attributes X in R is said to be functionally dependent on another set of attribute Y if and only if, for each one X value in R is associated with precisely one Y value in R. What is it? Normalisation by Ms.Amrit Kaur 14
  • 15.  Y(attribute) functionally dependent on X(attribute)  It is denoted by X->Y  The attribute on left hand side of arrow is called determinant.  The attribute on right side of arrow is called dependent. How is it represented? Normalisation by Ms.Amrit Kaur 15
  • 16.  Partial Functional Dependencies  A functional dependency in which one or more non key attributes are functionally dependent on part of primary key.  Fully Functional Dependencies  A functional dependency in which one or more non key attributes are totally depending functionally dependent on primary key. Transitivity Dependencies Types of Functional Dependencies Normalisation by Ms.Amrit Kaur 16
  • 17. Example: Converting 1 NF Table to 2NF Normalisation by Ms.Amrit Kaur 17
  • 18. CourseNo DepartmentName CourseName Room Enrollment 4604 CS Database 201 45 4604 Dance Tree Dancing 302 45 4604 English The Basics of Data 123 45 2604 CS Data Structure 456 100 2604 Physics Dark Matter 302 100 Step 1 ….Identify FD Normalisation by Ms.Amrit Kaur 18 Relation (Functional Dependency between CourseNo(X) and DepartmentName(Y) For each X values(CourseNo) 4604 – How many departmentName ???? … 3 (CS,Dance, English)….all are different…. 3 Y values (DepartmentName) . Hence, CourseNo and DepartmentName not functionally dependent Relation (Functional Dependency between CourseNo(X) and CourseName(Y) For each X values(CourseNo) 4604 – How many courseName ?? … 3 different courseName. It means 3 Y values (DepartmentName) . Hence, CourseNo and CourseName not functionally dependent
  • 19. CourseNo DepartmentName CourseName Room Enrollment 4604 CS Database 201 45 4604 Dance Tree Dancing 302 45 4604 English The Basics of Data 123 45 2604 CS Data Structure 456 100 2604 Physics Dark Matter 302 100 [contd.] Step 1 Normalisation by Ms.Amrit Kaur 19 Relation (Functional Dependency between CourseNo(X) and Room(Y) For each X values(CourseNo) 4604 –3 different rooms; i.e. 3 Y values . Hence, CourseNo and Room not functionally dependent Relation (Functional Dependency between CourseNo(X) and EnrollmentY) For each X values(CourseNo) 4604 – How many enrollment?? … 3 but value is 1; i.e. 45. It means 1 Y Value Hence, CourseNo and Enrollment are functionally dependent. CourseNo ->Enrollment
  • 20.  Identified Functional Dependencies considering each attributes individually and then attribute combinations 1. CourseNo -> Enrollment 2. CourseName -> Room 3. CourseName->Enrollment 4. CourseNo+DepartmentName -> CourseName 5. CoursrNo+DepartmentName -> Room 6. CourseNo+ Department -> Enrollment 7. CourseName+DepartmentName -> CourseNo 8. CoursrName+DepartmentName -> Room 9. CourseName+ Department -> Enrollment [contd] Step 1 Normalisation by Ms.Amrit Kaur 20
  • 21.  Make list of Determinants from identified FDs  Rules of Choosing Primary Key  Dependent cannot be primary key  For Determinant, the column must not contain duplicate values Step 2 ….Choose Primary Key Normalisation by Ms.Amrit Kaur 21
  • 22.  List of Determinants (left hand side of FDs)  CourseNo  CourseName  CourseNo+DepartmentName  CourseName+ DepartmentName  Identified functional dependencies in Step 1 [contd.] Step 2 Normalisation by Ms.Amrit Kaur 22 • Apply Rules – In FD (4), CourseName is dependent – In FD (7), CourseNo is dependent Both Cannot be Primary Key 1. CourseNo -> Enrollment 2. CourseName -> Room 3. CourseName->Enrollment 4. CourseNo+DepartmentName -> CourseName 5.CoursrNo+DepartmentName -> Room 6.CourseNo+ Department -> Enrollment 7.CourseName+DepartmentName -> CourseNo 8. CoursrName+DepartmentName -> Room 9. CourseName+ Department -> Enrollment • Choose any ONE as Primary Key – CourseNo + DepartmentName – CourseName + DepartmentName
  • 23. Partial Dependency means  one or more non key attributes are functionally dependent on part of primary key.  Identified functional dependencies in Step 1 Step 3…. Identify Partial Dependencies Normalisation by Ms.Amrit Kaur 23 DepartmentName->Enrollment (FALSE) It means from FD(1), Enrollment is depending on primary key as a whole and also ONLY on CourseNo (part of primary Key) . 1. CourseNo -> Enrollment 2. CourseName -> Room 3. CourseName->Enrollment 4. CourseNo+DepartmentName -> CourseName 5.CoursrNo+DepartmentName -> Room 6.CourseNo+ Department -> Enrollment 7.CourseName+DepartmentName -> CourseNo 8. CoursrName+DepartmentName -> Room 9. CourseName+ Department -> Enrollment • Identified PRIMARY KEY in Step2 CourseNo + DepartmentName • Partial Dependencies Exist CourseNo - Enrollment
  • 24.  Remove partial dependencies Enrollment from Table in 1 NF  Create separate table with Enrollment  Copy determinants CourseNo also Step 4 ….Remove Partial Dependencies Normalisation by Ms.Amrit Kaur 24 Course No DepartmentName CourseName Room 4604 CS Database 201 4604 Dance Tree Dancing 302 4604 English The Basics of Data 123 2604 CS Data Structure 456 2604 Physics Dark Matter 302 CourseNo Enrollment 4604 45 2604 100 After 2NF, Table Structure
  • 25. CustNo CustName ProdNo ProdName Price Qty Order No OrderDate C101 John P001 Pen 10 100 1 10.Oct.2020 C101 John P002 Pencil 3 200 2 11.Oct.2020 C102 Pat P001 Pen 10 130 3 10.Oct.2020 C102 Pat P1004 Eraser 5 150 4 12.Oct.2020 C102 Pat P006 Ruler 7 200 5 11.Oct.2020 Example 2. Convert Table to 2NF Normalisation by Ms.Amrit Kaur 25 Step1: Identify Functional Dependency (CustNo+ProdNo)->Qty (CustNo+ProdNo)->ProdName (CustNo+ProdNo)-> Price (CustNo+ProdNo)->OrderNo (CustNo+ProdNo)->OrderDate Step2: Identify Primary Key (CustNo+ProdNo) Step3: Partial Dependency (CustomerName is depending only on CustNo, not on ProdNo CustNo->Custname (ProductName is depending only on ProdNo not on CustNo Prodno->ProdName STEP 4. Remove dependencies CustName and ProdName from Table in 1 NF and create two separate tables and copy determinants CustNo and ProdNo respectively.
  • 26. Example 2. After 2 NF Normalisation by Ms.Amrit Kaur 26 CustNo CustName C101 John C102 Pat CustNo ProdNo Price Qty OrderNo OrderDate C101 P001 10 100 1 10.Oct.2020 C101 P002 3 200 2 11.Oct.2020 C102 P001 10 130 3 10.Oct.2020 C102 P1004 5 150 4 12.Oct.2020 C102 P006 7 200 5 11.Oct.2020 ProdNo ProdName P001 Pen P002 Pencil P1004 Eraser P006 Ruler Customer Product Purchase
  • 27. Third Normal Form Normalisation by Ms.Amrit Kaur 27
  • 28.  Third Normal Form  RULE: A relation is in 3NF if and only if it is in 2NF and every nonkey attribute is non transitively dependent on primary key.  Procedure: Converting 2NF to 3NF  Identify Functional Dependencies  Identify primary key  If transitive dependency exist on primary key, remove them by placing them in new relation along with dominant. 3NF Normalisation by Ms.Amrit Kaur 28
  • 29.  A transitive dependency exists when the following functional dependency pattern:  A → B  B → C ; therefore A → C.  If any attribute is depending upon primary key and also depending upon other attribute What is Transitive Dependency? Normalisation by Ms.Amrit Kaur 29
  • 30. Example: Converting 2NF Table to 3NF Normalisation by Ms.Amrit Kaur 30
  • 31. 2 NF Tables Normalisation by Ms.Amrit Kaur 31 CustNo CustName C101 John C101 John C102 Pat C102 Pat C102 Pat CustNo ProdNo Price Qty OrderNo OrderDate C101 P001 10 100 1 10.Oct.2020 C101 P002 3 200 2 11.Oct.2020 C102 P001 10 130 3 10.Oct.2020 C102 P1004 5 150 4 12.Oct.2020 C102 P006 7 200 5 11.Oct.2020 ProdNo ProdName P001 Pen P002 Pencil P001 Pen P1004 Eraser P006 Ruler Customer Product Purchase
  • 32. Steps…Converting 2NF to 3NF Normalisation by Ms.Amrit Kaur 32 Step1: Identify Functional Dependency Customer Relation 1. CustNo -> CustName Product Relation 2. ProdNo -> ProdName Purchase Relation 3. (CustNo+ProdNo)->Qty 4. (CustNo+ProdNo)-> Price 5. (CustNo+ProdNo)->OrderNo 6. (CustNo+ProdNo)->OrderDate 7. OrderNo -> OrderDate Step2: Identify Primary Key Customer Relation – CustNo Product Relation – ProdNo Purchase – CustNo+ ProdNO Step3: Transitive Dependency Non key attribute is depending upon other attribute that is not primary key then transitive dependencies exist. Here (CustNo+ProdNo)->OrderNo OrderNo -> OrderDate (CustNo+ProdNo)->OrderDate STEP 4. Remove transitive dependencies OrderDate from Table in 2 NF and create separate tables and copy OrderNo
  • 33. After 3 NF Normalisation by Ms.Amrit Kaur 33 CustNo CustName C101 John C101 John C102 Pat C102 Pat C102 Pat CustNo ProdNo Price Qty OrderNo C101 P001 10 100 1 C101 P002 3 200 2 C102 P001 10 130 3 C102 P1004 5 150 4 C102 P006 7 200 5 ProdNo ProdName P001 Pen P002 Pencil P001 Pen P1004 Eraser P006 Ruler Customer Product Purchase OrderNo OrderDate 1 10.Oct.2020 2 11.Oct.2020 3 10.Oct.2020 4 12.Oct.2020 5 11.Oct.2020 Order
  • 34. Boyce Codd Normal Form(BCNF) Normalisation by Ms.Amrit Kaur 34
  • 35.  Relations in 3NF still contain redundancy when  There are two or more candidate key  Candidate Keys are composite key  Candidate Key overlaps (one attribute common)  BCNF  RULE: A relation is in BCNF if and only if every determinant is a candidate key BCNF Normalisation by Ms.Amrit Kaur 35
  • 36.  Procedure: Converting to BCNF  Identify all candidate keys  Indentify all functional dependencies  If functional dependencies exist where determinants are not candidate key, remove functional dependencies by placing them in new relation along with determinant BCNF Normalisation by Ms.Amrit Kaur 36
  • 37. Example: Apply BCNF Normalisation by Ms.Amrit Kaur 37 ClientNo InterviewDate Interview Time Staff No Room No C176 20-Oct-2020 10:30 S5 101 C156 20-Oct-2020 12:00 S5 101 C174 20-Oct-2020 12:00 S37 102 C156 22-Oct-2020 10:30 S5 102 Primary Key (ClientNo,InterviewDate)->(InterviewTime,StaffNo,RoomNo) Candidate Keys 1. (StaffNo,InterviewDat,InterviewTime) -> (ClientNo, RoomNo) 2. (RoomNo,InterviewDate,InterviewTime)-> (StaffNo, ClientNo) Other Functional Dependency – Determinant not Candidate Key Remove and create another relation and copy determinant 1. (StaffNo, InterviewDate) -> RoomNo
  • 38. After BCNF Normalisation by Ms.Amrit Kaur 38 ClientNo InterviewDate Interview Time Staff No C176 20-Oct-2020 10:30 S5 C156 20-Oct-2020 12:00 S5 C174 20-Oct-2020 12:00 S37 C156 22-Oct-2020 10:30 S5 Staff No InterviewDate Room No S5 20-Oct-2020 101 S37 20-Oct-2020 101 S5 22-Oct-2020 102
  • 40. Thank You Normalisation by Ms.Amrit Kaur 40