SlideShare a Scribd company logo
CHAPTER 4
NORMALIZATION

Dr.Girija Narasimhan

1
WHAT IS NORMALIZATION
Break down
Inconsistency It is the process of decomposing relation with
or
anomalies into small relations
abnormal

Why?
Ensuring Data Integrity

Remove Data Redundancy

Satisfies all integrity constraints

Domain integrity, entity integrity
constraints, referential integrity
constraints

Prevent insert,delete,update
anomaly. Since, the data is
only available in one table in
the database

Dr.Girija Narasimhan

2
INSERT ANOMALY
The primary key for this table is the combination of Emp_ID and Course_Title

EmpId
100
100
140
110
110
150
150

Ename
Ali
Ali
Said
ahmed
ahmed
Khalid
khalid

DeptName
Marketting
Marketting
Accounting
Infosystem
Infosystem
Marketting
Marketting

Salary
4800
4800
5200
4300
4300
4200
4200

Course_Title
SPSS
Surveys
Tax Acc
Visual Basic
C++
SPSS
Java

Date_Completed
6/19/2011
10/7/2011
12/8/2011
1/12/2011
4/22/2011
6/19/2011
8/12/2011

Because, in the new record empid is available but course_title is Null. As per entity
integrity rule primary key must have not null value.

EmpId
100

Ename
Ali

DeptName
Marketting

Salary
4800

Course_Title Date_Completed
Null
6/19/2011

This is insert anomaly
Dr.Girija Narasimhan

3
UPDATE ANOMALY
EmpId 150 has two records, the salary as 4200

EmpId
100
100
140
110
110
150
150

Ename
Ali
Ali
Said
ahmed
ahmed
Khalid
khalid

DeptName
Marketting
Marketting
Accounting
Infosystem
Infosystem
Marketting
Marketting

Salary
4800
4800
5200
4300
4300
4200
4200

Course_Title
SPSS
Surveys
Tax Acc
Visual Basic
C++
SPSS
Java

Date_Completed
6/19/2011
10/7/2011
12/8/2011
1/12/2011
4/22/2011
6/19/2011
8/12/2011

Once record change the salary as 4500 and another record missed for
updating the changes is called update anomaly

EmpId
150
150

Ename
Khalid
khalid

DeptName
Marketting
Marketting

Salary
4200
4500

Course_Title Date_Completed
SPSS
6/19/2011
Java
8/12/2011

This is update anomaly
Dr.Girija Narasimhan

4
DELETE ANOMALY
EmpId
100
100
140
110
110
150
150

Ename
Ali
Ali
Said
ahmed
ahmed
Khalid
khalid

DeptName
Marketting
Marketting
Accounting
Infosystem
Infosystem
Marketting
Marketting

Salary
4800
4800
5200
4300
4300
4200
4200

Course_Title
SPSS
Surveys
Tax Acc
Visual Basic
C++
SPSS
Java

Date_Completed
6/19/2011
10/7/2011
12/8/2011
1/12/2011
4/22/2011
6/19/2011
8/12/2011

Suppose delete empid 140, it also delete the course_title and date_completed also.

EmpId
140

Ename
Said

DeptName Salary
Accounting 5200

Course_Title Date_Completed
Tax Acc
12/8/2011

Dr.Girija Narasimhan

5
Exercise 1- Anomaly
Apply insert, update, delete anomaly for the given
below table
Passenger

Passenger

ID

Name

101

Ali

Sohar

AI977

Muscat

101

Ali

Sohar

AI976

Hyderabad Muscat

102

Rahman

Muscat

WY899 Muscat

102

Rahman

Muscat

AI976

Address

FlightI

Origin

Destination

PilotID

D

Pilot

Fare

Name

Hyderbad

Dr.Girija Narasimhan

Hyderabad

AIP10

Raja

30

AIP12

Kiran

34

Riyad

WYP10

Said

28

Muscat

AIP11

Ram

30

6
Exercise 2- Anomaly
Apply insert, update, delete anomaly for the given
below table
Accno

Accounttype

date_acct-

Opened

Manager

Manager

ID

cid cname balance

Name

100

loan

21-10-2011 1

alia

100

10

shaik

101

saving

28-10-2011 1

alia

200

10

shaik

102

current

30-10-2011 1

alia

100

20

ali

103

loan

25-10-2011 2

fatma 100

10

shaik

104

current

30-10-2011 2

fatma 200

30

saeed

Dr.Girija Narasimhan

7
NORMALIZATION
Student Name Date
ID
of
Birth

Adviso Advisor
rID
Name

Advisor CourseID
Phone

Course
Name

Credit
Hrs

Multimedia 6

Passin
g
Grade

Std
Mark

D

60

S01234

Ali

5/7/90 11

Mr. Aijaz

123

ITSE1100

S01234

Ali

5/7/90 11

Mr. Aijaz

123

ITNT1103 Hardware

5

C

70

S01234

Ali

5/7/90 11

Mr. Aijaz

123

ITDB1102 Database

5

C

50

S01235

Said

6/5/89 12

Ms. Aysha

124

ITSE1100

Multimedia 6

D

70

S01235

Said

6/5/89 12

Ms. Aysha

124

ITNT1103 Hardware

C

80

5

Repeating data (Data Redundancy)

Adjust the table to have one value in each cell
Separate the repeating group fields into a separate table
Determine the primary keys and foreign keys in each table
Provide the link between primary key and foreign key
Dr.Girija Narasimhan

8
First Normal Form (1NF)
Adjust the table to have one value in each cell
Separate the repeating group fields into a separate table.
Student table
StudentID

Date of
Birth

AdvisorID

Advisor Name

Advisor Phone No

S01234

Ali

5/7/90

11

Mr. Aijaz

123

S01235

Primary key

Name

Said

6/5/89

12

Ms. Aysha

124

Create the another table name as “student-course table”
and keep all the remaining attributes
Student –course table
StudentID

Composite
primary key

Course Name

Credit Hrs

Passing Grade

Std
Mark

S01234

ITSE1100

Multimedia

6

D

60

S01234
S01234

Foreign key

CourseID

ITNT1103
ITDB1102

Hardware
Database

5
5

C
C

70
50

S01235

ITSE1100

Multimedia

6

D

70

S01235

ITNT1103

Hardware

5

C

80

Dr.Girija Narasimhan

9
Second Normal Form (2NF)
1NF → 2NF

Partial functional dependency

Find out the non key fields which do not depend on the whole primary key
(partial functional dependency column)and place them in a separate table with a link
Course table
CourseID
ITSE1100

Course Name
Multimedia

Credit Hours
6

Passing grade
D

ITNT1103

Hardware

5

C

ITDB1102

Database

5

C

Student –course table
StudentID
S01234
S01234
S01234
S01234
S01235
S01235

CourseID
ITSE1100
ITNT1103
ITDB1102
ITDB1102
ITSE1100
ITNT1103

Std Mark
60
70
50
70
70
80

Dr.Girija Narasimhan

10
2NF → 3NF

Third Normal Form (3NF)

Transitive dependency: A relationship between two (or more) nonkey attributes
For each non key attribute (or set of attributes) that is a determinant in a relation,
create a new relation. That attribute (or set of attributes) becomes the primary key of
the new relation
Foreign key
Course Table
CourseID

StudentI
D
S01234
S01235

Name
Ali
Said

Date of
Birth
5/7/90
6/5/89

11
12

Advisor table
AdvisorI
D
11
12

Advisor
Advisor Phone No
Name
Mr. Aijaz 123
Ms.Aysha 124

ITSE1100

Passing
grade
D

Hardware

5

C

ITDB1102

AdvisorID

Course
Credit
Name
Hours
Multimedia 6

ITNT1103

Student table

Database

5

C

Student –course table
StudentID
S01234
S01234
S01234
S01234
S01235
S01235
Dr.Girija Narasimhan

CourseID
ITSE1100
ITNT1103
ITDB1102
ITDB1102
ITSE1100
ITNT1103

Std Mark
60
70
50
70
70
80
11
Dr.Girija Narasimhan

12
Dr.Girija Narasimhan

13
1NF Tables: Repeating Attributes Removed
Project table
Project Code

Project Title

Project Manager

Project Budget

PC010

Pensions System

M Phillips

24500

PC045

Salaries System

H Martin

17400

PC064

HR System

K Lewis

12250

Employee table
Project Code Employee No. Employee Name Department No.

Department
Name

Hourly Rate

PC010

S10001

A Smith

L004

IT

22.00

PC010

S10030

L Jones

L023

Pensions

18.50

PC010

S21010

P Lewis

L004

IT

21.00

PC045

S10010

B Jones

L004

IT

21.75

PC045

S10001

A Smith

L004

IT

18.00

PC045

S31002

T Gilbert

L028

Database

25.50

PC045

S13210

W Richards

L008

Salary

17.00

PC064

S31002

T Gilbert

L028

Database

23.25

PC064

S21010

P Lewis

L004

IT

17.50

PC064

S10034

B James

L009

HR

16.50

Dr.Girija Narasimhan

14
2NF Tables: Partial Key Dependencies Removed
Project table
Project
Code

Project Title

Project
Manager

Project
Budget

PC010

Pensions System

M Phillips

24500

PC045

Salaries System

H Martin

17400

PC064

HR System

K Lewis

12250

Employee table

Employee-project table
Project
Code

Employee
No.

Hourly
Rate

PC010

S10001

22.00

PC010

S10030

18.50

PC010

S21010

21.00

PC045

S10010

21.75

PC045

S10001

PC045

Employee Employee
No.
Name

Department
No.

Department
Name

S10001

A Smith

L004

IT

S10030

L Jones

L023

Pensions

S21010

P Lewis

L004

IT

18.00

S10010

B Jones

L004

IT

S31002

25.50

S31002

T Gilbert

L028

Database

PC045

S13210

17.00

S13210

W Richards

L008

Salary

PC064

S31002

23.25

S10034

B James

L009

HR

PC064

S21010

17.50

PC064

S10034

16.50

Dr.Girija Narasimhan

15
Project table
Project
Code

Project Title

Project
Manager

Project
Budget

PC010

Pensions System

M Phillips

24500

PC045

Salaries System

H Martin

17400

PC064

HR System

K Lewis

12250

Employee table

Employee-project table
Project
Code

Employee
No.

Hourly
Rate

PC010

S10001

22.00

PC010

S10030

18.50

PC010

S21010

21.00

PC045

S10010

21.75

PC045

S10001

PC045

Employee Employee
No.
Name

Department
No.

Department
Name

S10001

A Smith

L004

IT

S10030

L Jones

L023

Pensions

S21010

P Lewis

L004

IT

18.00

S10010

B Jones

L004

IT

S31002

25.50

S31002

T Gilbert

L028

Database

PC045

S13210

17.00

S13210

W Richards

L008

Salary

PC064

S31002

23.25

S10034

B James

L009

HR

PC064

S21010

17.50

PC064

S10034

16.50

Dr.Girija Narasimhan

16
Project table

3NF Tables: Non-Key Dependencies Removed
Employee table

Project
Code

Project Title

Project
Manager

Project
Budget

Employee
No.

Employee
Name

PC010

Pensions System

M Phillips

24500

S10001

A Smith

L004

PC045

Salaries System

H Martin

17400

S10030

L Jones

L023

PC064

HR System

K Lewis

12250

S21010

P Lewis

L004

S10010

B Jones

L004

S31002

T Gilbert

L023

S13210

W Richards

L008

S10034

B James

Employee-project table
Project
Code

Employee
No.

Hourly
Rate

PC010

S10001
S10030

18.50

PC010

S21010

21.00

PC045

S10010

21.75

PC045

S10001

18.00

PC045

S31002

25.50

PC045

S13210

17.00

PC064

S31002

PC064
PC064

L0009

22.00

PC010

Department No.
*

Department table
Department No.

Department Name

L004

IT

L023

Pensions

L028

Database

23.25

L008

Salary

S21010

17.50

L009

HR

S10034

16.50

Dr.Girija Narasimhan

17

More Related Content

PPTX
Linked stacks and queues
PPT
PPTX
Normalization in a Database
PDF
Normalization | (1NF) |(2NF) (3NF)|BCNF| 4NF |5NF
PPT
Database Normalization 1NF, 2NF, 3NF, BCNF, 4NF, 5NF
PPTX
Entity relationship diagram - Concept on normalization
PDF
Database Normalization
PPTX
normaliztion
Linked stacks and queues
Normalization in a Database
Normalization | (1NF) |(2NF) (3NF)|BCNF| 4NF |5NF
Database Normalization 1NF, 2NF, 3NF, BCNF, 4NF, 5NF
Entity relationship diagram - Concept on normalization
Database Normalization
normaliztion

What's hot (20)

PPT
Er & eer to relational mapping
PPTX
Transaction management in DBMS
PPT
Joins in SQL
PDF
Library management system
PPTX
Data Manipulation Language
PPTX
FIle Organization.pptx
PPTX
DBMS: Types of keys
PPT
Normalization
PPTX
Database Normalization
PPT
Normalization case
PPTX
Degree of relationship set
PDF
Tutorial aplikasi toko online berbasis web dengan PHP
PPTX
Inner join and outer join
PDF
FP304 DATABASE SYSTEM PAPER FINAL EXAM AGAIN
PPTX
Normalization in DBMS
PPT
ER DIAGRAM TO RELATIONAL SCHEMA MAPPING
PDF
Entity Relationship Diagram of Library System
PPTX
Dbms normalization
PPTX
Understanding Web Cache
PDF
Dbms interview questions
Er & eer to relational mapping
Transaction management in DBMS
Joins in SQL
Library management system
Data Manipulation Language
FIle Organization.pptx
DBMS: Types of keys
Normalization
Database Normalization
Normalization case
Degree of relationship set
Tutorial aplikasi toko online berbasis web dengan PHP
Inner join and outer join
FP304 DATABASE SYSTEM PAPER FINAL EXAM AGAIN
Normalization in DBMS
ER DIAGRAM TO RELATIONAL SCHEMA MAPPING
Entity Relationship Diagram of Library System
Dbms normalization
Understanding Web Cache
Dbms interview questions
Ad

Similar to normalization (20)

PPS
Analysis Design
PDF
ITIL - Exam Results
PDF
Introduction to Data Warehousing
PDF
Root Cause Analysis - RCA Training Module
PDF
ITIL_Service_Operation_Results
PDF
PPTX
Chapter 7 Working with two result sets
PDF
dotnet3_A610635_aditiDalmia
PDF
SoR (1)
PPTX
O Level Paper 2 database All topics of chapter
DOC
Mis course outline final
PPTX
Research methodology
PPTX
Normalization by Ashwin and Tanmay
PPT
Web Based Knowledge Check
PDF
Statement Of Results ITIL
PDF
ITIL® V3 Foundation Exam Tutorial
Analysis Design
ITIL - Exam Results
Introduction to Data Warehousing
Root Cause Analysis - RCA Training Module
ITIL_Service_Operation_Results
Chapter 7 Working with two result sets
dotnet3_A610635_aditiDalmia
SoR (1)
O Level Paper 2 database All topics of chapter
Mis course outline final
Research methodology
Normalization by Ashwin and Tanmay
Web Based Knowledge Check
Statement Of Results ITIL
ITIL® V3 Foundation Exam Tutorial
Ad

More from Girija Muscut (20)

PPTX
Tamil Nalvar
PPTX
Visualization using Tableau
PDF
Introduction to ml
PDF
Effective Visualization with Tableau
PPTX
Guruvayoor song with audio-Udayasthamana puja
PPTX
Lakshmi lalli with audio
PPTX
Bagyada laskhmi purandara dasa
PPTX
Lakshmi lalli
PPTX
Amba nee irangaayenil - papanasam sivan song
PPTX
Mahalakshmi jagan madha - papanasm sivan tamil song
PDF
Sowbhagayaha laskhmi varuvai nee tamil song
PPTX
Bega baro Bega baro Neela Megha Varna-Vadhiraja Theertha
PPTX
Rama Nama Bhajan
PPTX
Saratha devi song 1
PPTX
Saraswathi bhajan 1 with tamil meaning
PPTX
Aneyu karadare -Purandara Dasar.
PDF
Maithriam Bhajatha with tamil meaning (lyrics)
PPTX
Unit 4 scd2-exercise 1-solution
PPTX
Unit 2 - Slowly Changing Dimension Type 1 (SCD1) (insert)
PPTX
Slowly Changing Dimension Type 1 (SCD 1) exercise 2 solution insert and update
Tamil Nalvar
Visualization using Tableau
Introduction to ml
Effective Visualization with Tableau
Guruvayoor song with audio-Udayasthamana puja
Lakshmi lalli with audio
Bagyada laskhmi purandara dasa
Lakshmi lalli
Amba nee irangaayenil - papanasam sivan song
Mahalakshmi jagan madha - papanasm sivan tamil song
Sowbhagayaha laskhmi varuvai nee tamil song
Bega baro Bega baro Neela Megha Varna-Vadhiraja Theertha
Rama Nama Bhajan
Saratha devi song 1
Saraswathi bhajan 1 with tamil meaning
Aneyu karadare -Purandara Dasar.
Maithriam Bhajatha with tamil meaning (lyrics)
Unit 4 scd2-exercise 1-solution
Unit 2 - Slowly Changing Dimension Type 1 (SCD1) (insert)
Slowly Changing Dimension Type 1 (SCD 1) exercise 2 solution insert and update

Recently uploaded (20)

PPTX
Lesson notes of climatology university.
PPTX
human mycosis Human fungal infections are called human mycosis..pptx
PPTX
Presentation on HIE in infants and its manifestations
PPTX
Final Presentation General Medicine 03-08-2024.pptx
PDF
O7-L3 Supply Chain Operations - ICLT Program
PPTX
Cell Structure & Organelles in detailed.
PDF
FourierSeries-QuestionsWithAnswers(Part-A).pdf
PPTX
202450812 BayCHI UCSC-SV 20250812 v17.pptx
PDF
102 student loan defaulters named and shamed – Is someone you know on the list?
PDF
O5-L3 Freight Transport Ops (International) V1.pdf
PDF
Complications of Minimal Access Surgery at WLH
PDF
A GUIDE TO GENETICS FOR UNDERGRADUATE MEDICAL STUDENTS
PPTX
Tissue processing ( HISTOPATHOLOGICAL TECHNIQUE
PDF
Chinmaya Tiranga quiz Grand Finale.pdf
PDF
01-Introduction-to-Information-Management.pdf
PDF
A systematic review of self-coping strategies used by university students to ...
PPTX
Cell Types and Its function , kingdom of life
PDF
Computing-Curriculum for Schools in Ghana
PPTX
Microbial diseases, their pathogenesis and prophylaxis
PDF
Microbial disease of the cardiovascular and lymphatic systems
Lesson notes of climatology university.
human mycosis Human fungal infections are called human mycosis..pptx
Presentation on HIE in infants and its manifestations
Final Presentation General Medicine 03-08-2024.pptx
O7-L3 Supply Chain Operations - ICLT Program
Cell Structure & Organelles in detailed.
FourierSeries-QuestionsWithAnswers(Part-A).pdf
202450812 BayCHI UCSC-SV 20250812 v17.pptx
102 student loan defaulters named and shamed – Is someone you know on the list?
O5-L3 Freight Transport Ops (International) V1.pdf
Complications of Minimal Access Surgery at WLH
A GUIDE TO GENETICS FOR UNDERGRADUATE MEDICAL STUDENTS
Tissue processing ( HISTOPATHOLOGICAL TECHNIQUE
Chinmaya Tiranga quiz Grand Finale.pdf
01-Introduction-to-Information-Management.pdf
A systematic review of self-coping strategies used by university students to ...
Cell Types and Its function , kingdom of life
Computing-Curriculum for Schools in Ghana
Microbial diseases, their pathogenesis and prophylaxis
Microbial disease of the cardiovascular and lymphatic systems

normalization

  • 2. WHAT IS NORMALIZATION Break down Inconsistency It is the process of decomposing relation with or anomalies into small relations abnormal Why? Ensuring Data Integrity Remove Data Redundancy Satisfies all integrity constraints Domain integrity, entity integrity constraints, referential integrity constraints Prevent insert,delete,update anomaly. Since, the data is only available in one table in the database Dr.Girija Narasimhan 2
  • 3. INSERT ANOMALY The primary key for this table is the combination of Emp_ID and Course_Title EmpId 100 100 140 110 110 150 150 Ename Ali Ali Said ahmed ahmed Khalid khalid DeptName Marketting Marketting Accounting Infosystem Infosystem Marketting Marketting Salary 4800 4800 5200 4300 4300 4200 4200 Course_Title SPSS Surveys Tax Acc Visual Basic C++ SPSS Java Date_Completed 6/19/2011 10/7/2011 12/8/2011 1/12/2011 4/22/2011 6/19/2011 8/12/2011 Because, in the new record empid is available but course_title is Null. As per entity integrity rule primary key must have not null value. EmpId 100 Ename Ali DeptName Marketting Salary 4800 Course_Title Date_Completed Null 6/19/2011 This is insert anomaly Dr.Girija Narasimhan 3
  • 4. UPDATE ANOMALY EmpId 150 has two records, the salary as 4200 EmpId 100 100 140 110 110 150 150 Ename Ali Ali Said ahmed ahmed Khalid khalid DeptName Marketting Marketting Accounting Infosystem Infosystem Marketting Marketting Salary 4800 4800 5200 4300 4300 4200 4200 Course_Title SPSS Surveys Tax Acc Visual Basic C++ SPSS Java Date_Completed 6/19/2011 10/7/2011 12/8/2011 1/12/2011 4/22/2011 6/19/2011 8/12/2011 Once record change the salary as 4500 and another record missed for updating the changes is called update anomaly EmpId 150 150 Ename Khalid khalid DeptName Marketting Marketting Salary 4200 4500 Course_Title Date_Completed SPSS 6/19/2011 Java 8/12/2011 This is update anomaly Dr.Girija Narasimhan 4
  • 5. DELETE ANOMALY EmpId 100 100 140 110 110 150 150 Ename Ali Ali Said ahmed ahmed Khalid khalid DeptName Marketting Marketting Accounting Infosystem Infosystem Marketting Marketting Salary 4800 4800 5200 4300 4300 4200 4200 Course_Title SPSS Surveys Tax Acc Visual Basic C++ SPSS Java Date_Completed 6/19/2011 10/7/2011 12/8/2011 1/12/2011 4/22/2011 6/19/2011 8/12/2011 Suppose delete empid 140, it also delete the course_title and date_completed also. EmpId 140 Ename Said DeptName Salary Accounting 5200 Course_Title Date_Completed Tax Acc 12/8/2011 Dr.Girija Narasimhan 5
  • 6. Exercise 1- Anomaly Apply insert, update, delete anomaly for the given below table Passenger Passenger ID Name 101 Ali Sohar AI977 Muscat 101 Ali Sohar AI976 Hyderabad Muscat 102 Rahman Muscat WY899 Muscat 102 Rahman Muscat AI976 Address FlightI Origin Destination PilotID D Pilot Fare Name Hyderbad Dr.Girija Narasimhan Hyderabad AIP10 Raja 30 AIP12 Kiran 34 Riyad WYP10 Said 28 Muscat AIP11 Ram 30 6
  • 7. Exercise 2- Anomaly Apply insert, update, delete anomaly for the given below table Accno Accounttype date_acct- Opened Manager Manager ID cid cname balance Name 100 loan 21-10-2011 1 alia 100 10 shaik 101 saving 28-10-2011 1 alia 200 10 shaik 102 current 30-10-2011 1 alia 100 20 ali 103 loan 25-10-2011 2 fatma 100 10 shaik 104 current 30-10-2011 2 fatma 200 30 saeed Dr.Girija Narasimhan 7
  • 8. NORMALIZATION Student Name Date ID of Birth Adviso Advisor rID Name Advisor CourseID Phone Course Name Credit Hrs Multimedia 6 Passin g Grade Std Mark D 60 S01234 Ali 5/7/90 11 Mr. Aijaz 123 ITSE1100 S01234 Ali 5/7/90 11 Mr. Aijaz 123 ITNT1103 Hardware 5 C 70 S01234 Ali 5/7/90 11 Mr. Aijaz 123 ITDB1102 Database 5 C 50 S01235 Said 6/5/89 12 Ms. Aysha 124 ITSE1100 Multimedia 6 D 70 S01235 Said 6/5/89 12 Ms. Aysha 124 ITNT1103 Hardware C 80 5 Repeating data (Data Redundancy) Adjust the table to have one value in each cell Separate the repeating group fields into a separate table Determine the primary keys and foreign keys in each table Provide the link between primary key and foreign key Dr.Girija Narasimhan 8
  • 9. First Normal Form (1NF) Adjust the table to have one value in each cell Separate the repeating group fields into a separate table. Student table StudentID Date of Birth AdvisorID Advisor Name Advisor Phone No S01234 Ali 5/7/90 11 Mr. Aijaz 123 S01235 Primary key Name Said 6/5/89 12 Ms. Aysha 124 Create the another table name as “student-course table” and keep all the remaining attributes Student –course table StudentID Composite primary key Course Name Credit Hrs Passing Grade Std Mark S01234 ITSE1100 Multimedia 6 D 60 S01234 S01234 Foreign key CourseID ITNT1103 ITDB1102 Hardware Database 5 5 C C 70 50 S01235 ITSE1100 Multimedia 6 D 70 S01235 ITNT1103 Hardware 5 C 80 Dr.Girija Narasimhan 9
  • 10. Second Normal Form (2NF) 1NF → 2NF Partial functional dependency Find out the non key fields which do not depend on the whole primary key (partial functional dependency column)and place them in a separate table with a link Course table CourseID ITSE1100 Course Name Multimedia Credit Hours 6 Passing grade D ITNT1103 Hardware 5 C ITDB1102 Database 5 C Student –course table StudentID S01234 S01234 S01234 S01234 S01235 S01235 CourseID ITSE1100 ITNT1103 ITDB1102 ITDB1102 ITSE1100 ITNT1103 Std Mark 60 70 50 70 70 80 Dr.Girija Narasimhan 10
  • 11. 2NF → 3NF Third Normal Form (3NF) Transitive dependency: A relationship between two (or more) nonkey attributes For each non key attribute (or set of attributes) that is a determinant in a relation, create a new relation. That attribute (or set of attributes) becomes the primary key of the new relation Foreign key Course Table CourseID StudentI D S01234 S01235 Name Ali Said Date of Birth 5/7/90 6/5/89 11 12 Advisor table AdvisorI D 11 12 Advisor Advisor Phone No Name Mr. Aijaz 123 Ms.Aysha 124 ITSE1100 Passing grade D Hardware 5 C ITDB1102 AdvisorID Course Credit Name Hours Multimedia 6 ITNT1103 Student table Database 5 C Student –course table StudentID S01234 S01234 S01234 S01234 S01235 S01235 Dr.Girija Narasimhan CourseID ITSE1100 ITNT1103 ITDB1102 ITDB1102 ITSE1100 ITNT1103 Std Mark 60 70 50 70 70 80 11
  • 14. 1NF Tables: Repeating Attributes Removed Project table Project Code Project Title Project Manager Project Budget PC010 Pensions System M Phillips 24500 PC045 Salaries System H Martin 17400 PC064 HR System K Lewis 12250 Employee table Project Code Employee No. Employee Name Department No. Department Name Hourly Rate PC010 S10001 A Smith L004 IT 22.00 PC010 S10030 L Jones L023 Pensions 18.50 PC010 S21010 P Lewis L004 IT 21.00 PC045 S10010 B Jones L004 IT 21.75 PC045 S10001 A Smith L004 IT 18.00 PC045 S31002 T Gilbert L028 Database 25.50 PC045 S13210 W Richards L008 Salary 17.00 PC064 S31002 T Gilbert L028 Database 23.25 PC064 S21010 P Lewis L004 IT 17.50 PC064 S10034 B James L009 HR 16.50 Dr.Girija Narasimhan 14
  • 15. 2NF Tables: Partial Key Dependencies Removed Project table Project Code Project Title Project Manager Project Budget PC010 Pensions System M Phillips 24500 PC045 Salaries System H Martin 17400 PC064 HR System K Lewis 12250 Employee table Employee-project table Project Code Employee No. Hourly Rate PC010 S10001 22.00 PC010 S10030 18.50 PC010 S21010 21.00 PC045 S10010 21.75 PC045 S10001 PC045 Employee Employee No. Name Department No. Department Name S10001 A Smith L004 IT S10030 L Jones L023 Pensions S21010 P Lewis L004 IT 18.00 S10010 B Jones L004 IT S31002 25.50 S31002 T Gilbert L028 Database PC045 S13210 17.00 S13210 W Richards L008 Salary PC064 S31002 23.25 S10034 B James L009 HR PC064 S21010 17.50 PC064 S10034 16.50 Dr.Girija Narasimhan 15
  • 16. Project table Project Code Project Title Project Manager Project Budget PC010 Pensions System M Phillips 24500 PC045 Salaries System H Martin 17400 PC064 HR System K Lewis 12250 Employee table Employee-project table Project Code Employee No. Hourly Rate PC010 S10001 22.00 PC010 S10030 18.50 PC010 S21010 21.00 PC045 S10010 21.75 PC045 S10001 PC045 Employee Employee No. Name Department No. Department Name S10001 A Smith L004 IT S10030 L Jones L023 Pensions S21010 P Lewis L004 IT 18.00 S10010 B Jones L004 IT S31002 25.50 S31002 T Gilbert L028 Database PC045 S13210 17.00 S13210 W Richards L008 Salary PC064 S31002 23.25 S10034 B James L009 HR PC064 S21010 17.50 PC064 S10034 16.50 Dr.Girija Narasimhan 16
  • 17. Project table 3NF Tables: Non-Key Dependencies Removed Employee table Project Code Project Title Project Manager Project Budget Employee No. Employee Name PC010 Pensions System M Phillips 24500 S10001 A Smith L004 PC045 Salaries System H Martin 17400 S10030 L Jones L023 PC064 HR System K Lewis 12250 S21010 P Lewis L004 S10010 B Jones L004 S31002 T Gilbert L023 S13210 W Richards L008 S10034 B James Employee-project table Project Code Employee No. Hourly Rate PC010 S10001 S10030 18.50 PC010 S21010 21.00 PC045 S10010 21.75 PC045 S10001 18.00 PC045 S31002 25.50 PC045 S13210 17.00 PC064 S31002 PC064 PC064 L0009 22.00 PC010 Department No. * Department table Department No. Department Name L004 IT L023 Pensions L028 Database 23.25 L008 Salary S21010 17.50 L009 HR S10034 16.50 Dr.Girija Narasimhan 17