0% found this document useful (0 votes)
2 views

Tutorial_Sheet__Functional_Dependencies_and_Normalization

The document provides a tutorial on functional dependencies and normalization in database design. It includes examples of identifying functional dependencies, validating them, and normalizing tables to 1NF, 2NF, and 3NF. Each section contains questions and solutions demonstrating the concepts clearly.

Uploaded by

Harsh Garg
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
2 views

Tutorial_Sheet__Functional_Dependencies_and_Normalization

The document provides a tutorial on functional dependencies and normalization in database design. It includes examples of identifying functional dependencies, validating them, and normalizing tables to 1NF, 2NF, and 3NF. Each section contains questions and solutions demonstrating the concepts clearly.

Uploaded by

Harsh Garg
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 4

Tutorial Sheet: Functional Dependencies and

Normalization

Functional Dependencies
Question 1: Identify Functional Dependencies
Given the table:

Student ID Student Name Student Age Course ID


101 Alice 20 CSE101
102 Bob 22 CSE102
101 Alice 20 CSE103
103 Charlie 21 CSE101

Solution:
• Student ID → Student N ame
• Student ID → Student Age
• Student ID, Course ID → Student N ame, Student Age

Question 2: Determine if the given set of FDs are valid


Given the following table and FDs:

Employee ID Department Salary Employee Name


E001 IT 50000 John
E002 HR 60000 Jane
E003 IT 55000 Jim
E004 HR 60000 Jill

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

Is this table in 1NF? If not, convert it to 1NF.


Solution: The table is not in 1NF because the Subjects column contains
multiple values. To convert it to 1NF, break the multi-valued column into
individual rows:

Student ID Subject
101 Math
101 Science
102 English
102 History
103 Math
103 Geography
103 History

Now the table is in 1NF.

Question 4: Convert to 2NF


Consider the following table:

Student ID Course ID Course Name Instructor


101 C101 DBMS Dr. Smith
102 C102 Networking Dr. Brown
101 C103 OS Dr. Clark

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:

Course ID Course Name Instructor


C101 DBMS Dr. Smith
C102 Networking Dr. Brown
C103 OS Dr. Clark

Now the table is in 2NF.

Question 5: Convert to 3NF


Consider the following table:

Student ID Department Department Head Course ID Course Name


101 CS Dr. Brown C101 DBMS
102 EE Dr. Green C102 Networking
103 CS Dr. Brown C103 OS

Primary Key: Student ID, Course ID


Is this table in 3NF? If not, convert it to 3NF.
Solution: The table is not in 3NF because there is a transitive dependency:
Department → Department Head.
To convert it to 3NF, break the table into three smaller tables:
Student Course Table:

Student ID Course ID
101 C101
102 C102
103 C103

3
Department Table:

Department Department Head


CS Dr. Brown
EE Dr. Green

Course Table:

Course ID Course Name


C101 DBMS
C102 Networking
C103 OS

Now the table is in 3NF.

You might also like