0% found this document useful (0 votes)
2 views5 pages

Week 8 Normalization

The document outlines the normalization process for two database scenarios: service visits and student course enrollments. It details the progression through 1NF, 2NF, and 3NF, identifying functional dependencies and eliminating partial and transitive dependencies to create final relations. The final relations include separate tables for clients, technicians, services, students, courses, enrollments, and instructors, with established foreign key constraints.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
2 views5 pages

Week 8 Normalization

The document outlines the normalization process for two database scenarios: service visits and student course enrollments. It details the progression through 1NF, 2NF, and 3NF, identifying functional dependencies and eliminating partial and transitive dependencies to create final relations. The final relations include separate tables for clients, technicians, services, students, courses, enrollments, and instructors, with established foreign key constraints.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 5

1.

Assumptions made-

Each row represents a unique service visit.

A technician can operate multiple vehicles, but in this report each service
visit is associated with one technician and one vehicle.

Clients can request multiple services.

Vehicle ID uniquely identifies a vehicle.

Service (Client, Service Type) is not unique — Cost varies per entry → must
include technician or vehicle to uniquely identify.

1NF

TaskReport( ClientName, ClientAddress, ServiceType, Cost, TechnicianName,


VehicleID)

2NF

Functional Dependencies:

ClientName → ClientAddress

TechnicianName → VehicleID

(ClientName, ServiceType, TechnicianName) → Cost


Partial Dependencies/FD’s Eliminated:

ClientName → ClientAddress

TechnicianName → VehicleID

Client (ClientName, ClientAddress)

Technician (TechnicianName, VehicleID)

ServiceTask (ClientName, ServiceType, TechnicianName, Cost)

3NF

FD’s eliminated - TechnicianName → VehicleID

Client (ClientName, ClientAddress)

Technician (TechnicianName, VehicleID)

ServiceTask (ClientName, ServiceType, TechnicianName, Cost)

Problem 2

Assumptions-

i. Each student can register for multiple courses.

ii. A course is uniquely identified by CourseNo + CourseSection

iii. Instructor teaches specific course sections

iv. Grades are specific to student-course combinations.

v. One phone number per instructor.

PKs- (Sname, CourseNo, CourseSection)


FDs –

i. Sname - Address, Level

(A student has one address and level.)

ii. (CourseNo, CourseSection) - CourseName, Instructor

(A course section is taught by one instructor and has one course name.)

iii. Instructor - Phone

(Each instructor has one phone number.)

iv. (Sname, CourseNo, CourseSection) - Grade

(Each student receives one grade per course section.)

1NF:

Enrollment (Sname, Address, Level, CourseNo, CourseSection, CourseName,


Instructor, Grade, Phone)

2NF

Partial Dependencies Identified and Eliminated:

1. Sname - Address, Level


(Student information depends only on Sname, not the full key.)
Eliminated by creating a separate Student relation.

2. (CourseNo, CourseSection) - CourseName, Instructor


(Course details depend only on CourseNo and CourseSection, not on
the full key.)
Eliminated by creating a separate Course relation.

Remaining FD in 2NF:

Instructor - Phone

(Sname, CourseNo, CourseSection) – Grade

Decomposed Relations in 2NF:

1. Student(Sname, Address, Level)


2. Course(CourseNo, CourseSection, CourseName, Instructor)

3. Enrollment(Sname, CourseNo, CourseSection, Grade)

o Foreign Keys: Sname - Student, (CourseNo, CourseSection) -


Course

Functional Dependencies Eliminated:

 Sname - Address, Level

 (CourseNo, CourseSection) - CourseName, Instructor

Functional Dependencies Remaining:

 (Sname, CourseNo, CourseSection) - Grade

 Instructor - Phone

Foreign Key Constraints Introduced:

 Enrollment.Sname - Student.Sname

 Enrollment.(CourseNo, CourseSection) - Course.(CourseNo,


CourseSection)

3NF

Assumptions:

The relations from 2NF are already free of partial dependencies.

Eliminate transitive dependencies where a non-key attribute depends on


another non-key attribute.

Transitive Dependency Identified and Eliminated:

 Instructor - Phone
This is a transitive dependency in the Course relation because
Instructor is not a key, but Phone depends on it.

We eliminate this by moving the phone number into a separate Instructor


relation.

Final Relations in 3NF:


1. Student (Sname, Address, Level)

2. Course (CourseNo, CourseSection, CourseName, Instructor)

Foreign Key: Instructor - Instructor.Name

3. Enrollment (Sname, CourseNo, CourseSection, Grade)

Foreign Keys:

Sname - Student

(CourseNo, CourseSection) - Course

4. Instructor (Instructor, Phone)

Functional Dependency Eliminated:

Instructor - Phone (moved to its own relation)

All Functional Dependencies (Final):

Sname → Address, Level (handled in Student relation)

(CourseNo, CourseSection) - CourseName, Instructor (in Course relation)

Instructor - Phone (in Instructor relation)

(Sname, CourseNo, CourseSection) - Grade (in Enrollment relation)

Final Foreign Key Constraints:

 Enrollment.Sname -Student.Sname

 Enrollment.(CourseNo, CourseSection) - Course.(CourseNo,


CourseSection)

 Course.Instructor - Instructor.Instructor

You might also like