Lab 2 FD Part 1: Exercise 1. You Have Been Given A Form Which Shows The Details of Technical Jobs Carried Out
Lab 2 FD Part 1: Exercise 1. You Have Been Given A Form Which Shows The Details of Technical Jobs Carried Out
Exercise 1. You have been given a form which shows the details of technical jobs carried out
for different schools by members of staff in the local college. You will note that one job may
require input from more than one member of staff. Each member of staff belongs to a department
within the college and the number of hours worked on each job along with the date the job was
undertaken are noted. A member of staff may work on more than one job on any given date.
The college would like to set up a relational database to manage the allocation of staff to jobs
and keep a more efficient record of the number of hours worked for each school within the
college.
Your task is making the database to 3NF (specify step by step: determine FDs, normalization,..).
345 Smith, Alan 2 Helpdesk 3440 18/9/07 346 Bus & Man 1.5
320 Young, Jill 3 Labs 3440 18/9/07 346 Bus & Man 4
Exercise 2. Based on the form below, design a database suitable for storing information.
(Name of counseling center)
(Code: ….)
Result
Test
Name of Registrant
Sex
Name of counselor
Code of counselor
Code of Registrant
Registration time
Referral Service
Start time of
consultation
Negative
Positive
Female
Male
Date
Age
Yes
No
No
Các trường thuộc tính phải là nguyên tố, không được chứa giá trị phức:
Trường TechName đang chứa giá trị phức -> chưa đạt chuẩn 1NF
Functional dependency:
TechNo FirstName LastName DeptId Department JobNo Date SchoolID School Hoursworked
380 Bob Jackson 3 Labs 3440 18/9/07 346 Bus & Man 2
320 Jill Young 3 Labs 3440 18/9/07 346 Bus & Man 4
Các trường thuộc tính không phải khóa chính, phải phụ thuộc hoàn toàn vào khóa chính. Không được
phép phụ thuộc 1 phần của khóa chính.
Functional dependency:
Functional dependency:
R3: Các thuộc tính còn lại + Khóa của R1 + Khóa của R2 = (Houseworked, TechNo, JobNo)
Functional dependency:
Các trường thuộc tính không phải khóa chính, phải phụ thuộc trực tiếp vào khóa chính. Không được
phép phụ thuộc bắc cầu thông qua thuộc tính khác.
Functional dependency:
DepId Department
1 Engineering
2 Helpdesk
3 Labs
Bảng R1b= Các thuộc tính còn lại + Khóa của bảng R1a = (TechNo, FirstName, LastName, DepId)
Functional dependency:
Functional dependency:
SchoolID School
192 Beauty
125 Computing
560 Design
Bảng R2b: Các thuộc tính còn lại + Khóa của R2a = (JobNo, Date, SchoolID)
Functional dependency:
JobNo -> Date, SchoolID
R3: Các thuộc tính còn lại + Khóa của R1b + Khóa của R2b = (Houseworked, TechNo, JobNo)
Functional dependency:
345 1002 3
345 1480 3
380 3670 4
380 3440 2
300 1450 1
300 1480 3
320 3440 4
320 1002 2.5
320 3670 2
EX2:
Tables:
R1(No, Date, Code of Registrant)
R2(Code of Registrant, Name of Registrant, Registration time, Age, Sex, Code of counselor, test, Code of
test)