Tutorial_Sheet__Functional_Dependencies_and_Normalization
Tutorial_Sheet__Functional_Dependencies_and_Normalization
Normalization
Functional Dependencies
Question 1: Identify Functional Dependencies
Given the table:
Solution:
• Student ID → Student N ame
• Student ID → Student Age
• Student ID, Course ID → Student N ame, Student Age
FDs:
• Employee ID → Employee N ame
• Department → Salary
• Employee N ame → Salary
1
Solution:
• FD1: Employee ID → Employee N ame is valid.
• FD2: Department → Salary is not valid because in the IT department,
the salaries are different for John (50000) and Jim (55000).
• FD3: Employee N ame → Salary is valid.
Normalization
Question 3: Normalize a Table to 1NF
Given the following table:
Student ID Subjects
101 Math, Science
102 English, History
103 Math, Geography, History
Student ID Subject
101 Math
101 Science
102 English
102 History
103 Math
103 Geography
103 History
2
Primary Key: Student ID, Course ID
Is this table in 2NF? If not, convert it to 2NF.
Solution: The table is not in 2NF because Course Name and Instructor
are functionally dependent on Course ID, which is part of the primary key.
To convert to 2NF, break the table into two smaller tables:
Student Course Table:
Student ID Course ID
101 C101
102 C102
101 C103
Course Table:
Student ID Course ID
101 C101
102 C102
103 C103
3
Department Table:
Course Table: