0% found this document useful (0 votes)
11 views6 pages

07 02 2025 Lab2 FD

The document outlines two exercises related to database design for a college's technical job allocation and a counseling center's consultation records. Exercise 1 involves normalizing a dataset to 3NF by identifying functional dependencies and creating separate tables for tech staff, departments, jobs, schools, and hours worked. Exercise 2 focuses on designing a database structure for consultation records, including normalization steps to streamline data related to registrants, counselors, and referral services.

Uploaded by

hoangvinhh0111
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOC, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
11 views6 pages

07 02 2025 Lab2 FD

The document outlines two exercises related to database design for a college's technical job allocation and a counseling center's consultation records. Exercise 1 involves normalizing a dataset to 3NF by identifying functional dependencies and creating separate tables for tech staff, departments, jobs, schools, and hours worked. Exercise 2 focuses on designing a database structure for consultation records, including normalization steps to streamline data related to registrants, counselors, and referral services.

Uploaded by

hoangvinhh0111
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOC, PDF, TXT or read online on Scribd
You are on page 1/ 6

Lab 2

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,..).

TechNo TechName DeptId Department JobNo Date SchoolID School Hoursworked

298 Walls, Ian 1 Engineering 1002 12/9/07 192 Beauty 2.5

298 Walls, Ian 1 Engineering 1003 12/9/07 125 Computing 5.5

345 Smith, Alan 2 Helpdesk 1002 12/9/07 192 Beauty 3

345 Smith, Alan 2 Helpdesk 3440 18/9/07 346 Bus & Man 1.5

345 Smith, Alan 2 Helpdesk 1480 15/9/07 192 Beauty 3

380 Jackson, 3 Labs 3670 19/9/07 560 Design 4


Bob

380 Jackson, 3 Labs 3440 18/9/07 346 Bus & Man 2


Bob

300 Jones, Joe 2 Helpdesk 1450 15/9/07 125 Computing 1

300 Jones, Joe 2 Helpdesk 1480 15/9/07 192 Beauty 3

320 Young, Jill 3 Labs 3440 18/9/07 346 Bus & Man 4

320 Young, Jill 3 Labs 1002 12/9/07 192 Beauty 2.5

320 Young, Jill 3 Labs 3670 19/9/07 560 Design 2

Exercise 2. Based on the form below, design a database suitable for storing information.
(Name of counseling center)

(Code: ….)

Consultation registers list

From …../…../…… To ……/……./………

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

Code of referral services:


0 – Not 1 – Care and 2 – ST1 care 3 – TB care 4 – Prevention of
recommend treatment mother-to-child
infection
5 – Family 6 – Other 7 – Support 8 - Detoxification
planning medical care groups
Bài làm:

Exercise 1:

Khóa chính : Techno -> Techname

Deptid -> department

JobNo -> Date, SchoolId,

SchoolId -> School

Techno, Deptid , JobNo -> HoursWorked

1. Tech Table:

TechNo TechName

298 Walls, Ian

345 Smith, Alan

380 Jackson, Bob

300 Jones, Joe

320 Young, Jill

2. Dept Table:

DeptId Department

1 Engineering

2 Helpdesk

3 Labs

3. Job Table:

JobNo Date SchoolID

1002 12/9/07 192

1003 12/9/07 125


3440 18/9/07 346

1480 15/9/07 192

3670 19/9/07 560

1450 15/9/07 125

4. School Table:

SchoolID School

192 Beauty

125 Computing

346 Bus & Man

560 Design

5. Hoursworked Table:

TechNo DeptId JobNo Hoursworked

298 1 1002 2.5

298 1 1003 5.5

345 2 1002 3

345 2 3440 1.5

345 2 1480 3

380 3 3670 4

380 3 3440 2

300 2 1450 1

300 2 1480 3

320 3 3440 4

320 3 1002 2.5

320 3 3670 2
Exercise 2:

Bước 1 : Thực hiện NF1: Normalize columns : sex , test , result There are 2 unnecessary columns so
convert them into 1 single column sex(Male/Female) , test(Yes/No), Result(Positive,Negative) :

Sex Test Result


Male/Female Yes/No Positive/Negative
Famale/Male Yes/No Positive/Negative

Bước 2: Tách ra các bảng có các khóa chính sau (NF2):

- No -> Date, Code of Registrant, Registration time, Start time of consultation, test , result.

- Code of registrant -> Name of Registrant, Age, Sex.

- Code of counselor -> Name of counselor.

- No -> referral services.

Bước 3: NF3

- Tách test -> result sang 1 bảng khác vì result chỉ phụ thuộc vào test

- Lập 1 bảng mới cho referral services

o No -> test

o Test -> result

o Code of referral services -> referral services

Bước 4: Kết quả

Bảng 1 : No -> Date, Code of Registrant, Registration time, Start time of consultation, Code of
counselor.

Bảng 2: Code of registrant -> Name of Registrant, Age, Sex.

Bảng 3: Code of counselor -> Name of counselor

Bảng 4: ,No , Code of counselor -> No, code of referral services (cả 2 có thể xác định lẫn nhau và
chỉ toán giá trị unique)

Bảng 5: test -> result


Bảng 6: Code of referral services -> referral services

Bảng 7 No -> test

You might also like