2.0 relational data model_contd
DESCRIPTION
DatabaseTRANSCRIPT
![Page 1: 2.0 Relational Data Model_contd](https://reader034.vdocuments.net/reader034/viewer/2022042519/55cf94bb550346f57ba40d44/html5/thumbnails/1.jpg)
FP 304 DATABASE
SYSTEM
2.0 RELATIONAL DATA MODEL
![Page 2: 2.0 Relational Data Model_contd](https://reader034.vdocuments.net/reader034/viewer/2022042519/55cf94bb550346f57ba40d44/html5/thumbnails/2.jpg)
Tankertanker Design
Tankertanker Design
Tankertanker Design
This topic provides the foundation for using relational database. Discussions on relation scheme, relation instance, relation keys, relationships, and integrity rules are covered in the topic. This topic also describes the fundamental operators to retrieve information from relational database such as; select, project, join,
cross product, and set operators: union, intersect, and difference. This topic also will cover on Normalization in database which consists of 1NF, 2NF, 3NF, BCNF and how to apply in it based on table/situation given.
OBJECTIVES
![Page 3: 2.0 Relational Data Model_contd](https://reader034.vdocuments.net/reader034/viewer/2022042519/55cf94bb550346f57ba40d44/html5/thumbnails/3.jpg)
Tankertanker Design
Tankertanker Design
Tankertanker Design
Normalization
A process for assigning attributes into a table and reduces data
redundancy and helps eliminate the data anomalies that associated
with poor database design (un-normalized)
![Page 4: 2.0 Relational Data Model_contd](https://reader034.vdocuments.net/reader034/viewer/2022042519/55cf94bb550346f57ba40d44/html5/thumbnails/4.jpg)
Tankertanker Design
Tankertanker Design
Tankertanker Design
The purposes of normalization
To ensure that the anomalies doesn’t occur
To reduce data or storage redundancy
To ensure easy for record searching/finding
![Page 5: 2.0 Relational Data Model_contd](https://reader034.vdocuments.net/reader034/viewer/2022042519/55cf94bb550346f57ba40d44/html5/thumbnails/5.jpg)
Tankertanker Design
Tankertanker Design
Tankertanker Design
Steps in Normalization
UNF
1NF 2NF 3NF
Remove repeating groups
Identify functional dependencies
Remove transitive dependencies
![Page 6: 2.0 Relational Data Model_contd](https://reader034.vdocuments.net/reader034/viewer/2022042519/55cf94bb550346f57ba40d44/html5/thumbnails/6.jpg)
Tankertanker Design
Tankertanker Design
Tankertanker Design
Functional Dependecies Fu
nct
ion
al
Dep
end
enci
es
Functional dependencies describe relationships between attributes in a relation
A relationship between attributes in which one attribute or group of attribute determines the value of another in the same table
![Page 7: 2.0 Relational Data Model_contd](https://reader034.vdocuments.net/reader034/viewer/2022042519/55cf94bb550346f57ba40d44/html5/thumbnails/7.jpg)
Tankertanker Design
Tankertanker Design
Tankertanker Design
Transitive Dependencies Tr
ansi
tive
D
epen
den
cies
A Functional dependency between 2 or more non-key attributes
A condition in which an attribute is dependent on another attributes that is not part of the primary key
A relation is in 3NF if it is in 2NF and has no transitive dependencies
Non-primary key attribute is functionally dependent on another non-primary key attribute
![Page 8: 2.0 Relational Data Model_contd](https://reader034.vdocuments.net/reader034/viewer/2022042519/55cf94bb550346f57ba40d44/html5/thumbnails/8.jpg)
Tankertanker Design
Tankertanker Design
Tankertanker Design
Normalize the table below:
Task ID # Task
Description Employee ID # Due Date Last Name
1 Management meeting
02 02/17/2008 Gauss
2 Create budget 02 01/01/2008 Gauss
3 Employee reviews
01 02/01/2008 Coulomb
4 Produce Report 02 02/01/2008 Gauss
![Page 9: 2.0 Relational Data Model_contd](https://reader034.vdocuments.net/reader034/viewer/2022042519/55cf94bb550346f57ba40d44/html5/thumbnails/9.jpg)
Tankertanker Design
Tankertanker Design
Tankertanker Design
SOLUTION STEPS UNF 1NF 2NF 3NF
TaskID TaskDesc EmpID DueDate LastName
TaskID TaskDesc TaskID EmpID DueDate LastName
TaskID TaskDesc TaskID EmpID DueDate EmpID LastName
TaskID TaskDesc TaskID EmpID DueDate EmpID LastName
![Page 10: 2.0 Relational Data Model_contd](https://reader034.vdocuments.net/reader034/viewer/2022042519/55cf94bb550346f57ba40d44/html5/thumbnails/10.jpg)
Tankertanker Design
Tankertanker Design
Tankertanker Design
FINAL TABLES
TaskID TaskDesc
1 Management meeting
2 Create budget
3 Employee reviews
4 Produce Report
TaskID EmpID DueDate
1 02 02/17/2008
2 02 01/01/2008
3 01 02/01/2008
4 02 02/01/2008
EmpID LastName
01 Coulomb
02 Gauss
TASK TASK_EMPLOYEE
EMPLOYEE
![Page 11: 2.0 Relational Data Model_contd](https://reader034.vdocuments.net/reader034/viewer/2022042519/55cf94bb550346f57ba40d44/html5/thumbnails/11.jpg)
Tankertanker Design
Tankertanker Design
Tankertanker Design
Normalize the table below:
Std SSN
Std City
Std Class
Offer No
Off Term
Off Year
Enr Grade
Course No
Crs Desc
S1 SEATTLE
JUN O1 FALL 2006 3.5 C1 DB
S1 SEATTLE
JUN O2 FALL 2006 3.3 C2 VB
S2 BOTHELL
JUN O3 SPRING 2007 3.1 C3 OO
S2 BOTHELL
JUN O2 FALL 2006 3.4 C2 VB
![Page 12: 2.0 Relational Data Model_contd](https://reader034.vdocuments.net/reader034/viewer/2022042519/55cf94bb550346f57ba40d44/html5/thumbnails/12.jpg)
Tankertanker Design
Tankertanker Design
Tankertanker Design
SOLUTION STEPS UNF 1NF 2NF 3NF
StdSSN StdCity StdClass OfferNo OffTerm OffYear EnrGrade CourseNo CrsDesc
StdSSN StdCity StdClass StdSSN OfferNo OffTerm OffYear EnrGrade CourseNo CrsDesc
StdSSN StdCity StdClass StdSSN OfferNo EnrGrade CourseNo CrsDesc OfferNo OffTerm OffYear
StdSSN StdCity StdClass StdSSN OfferNo EnrGrade CourseNo OfferNo OffTerm OffYear CourseNo CrsDesc
![Page 13: 2.0 Relational Data Model_contd](https://reader034.vdocuments.net/reader034/viewer/2022042519/55cf94bb550346f57ba40d44/html5/thumbnails/13.jpg)
Tankertanker Design
Tankertanker Design
Tankertanker Design
FINAL TABLES
StdSSN StdCity StdClass
S1 SEATTLE JUN
S2 BOTHELL JUN
StdSSN OfferNo EnrGrade CourseNo
S1 O1 3.5 C1
S1 O2 3.3 C2
S2 O3 3.1 C3
S2 O2 3.4 C2
OfferNo OffTerm OffYear
O1 FALL 2006
O2 FALL 2006
O3 SPRING 2007
CourseNo CrsDesc
C1 DB
C2 VB
C3 OO
STUDENT OFFER
STUDENT_OFFER COURSE
![Page 14: 2.0 Relational Data Model_contd](https://reader034.vdocuments.net/reader034/viewer/2022042519/55cf94bb550346f57ba40d44/html5/thumbnails/14.jpg)
Tankertanker Design
Tankertanker Design
Tankertanker Design
Student
_ID
Student_
Name
Subject_
Code
Subject_Name Credit
_
Hours
Grade Address Course Coordinator
S0001 Azlina bt
Ahmad
ACT410
ADM101
ART210
Computerised
Accounting
Graphic Design
4
4
4
A
B
C
Sentul Diploma in
Information
Technology
Fazilah
S0144 Amirul bin
Hamdan
ART310
ART230
BUS210
Graphic
Communication
Business
Organization
4
2
4
A
B
B
Shah
Alam
Diploma in
Computer
Graphic Design
Ahmad
S0151 Mazlina bt
Yakub
ART410
ART 210
BUS210
Promotion Design
Graphic Design
Business
Organisation
4
4
4
C
A
A
Shah
Alam
Associate
Diploma in
Interactive
Multimedia
Sahada
Normalize the tables below from UNF until 3NF
![Page 15: 2.0 Relational Data Model_contd](https://reader034.vdocuments.net/reader034/viewer/2022042519/55cf94bb550346f57ba40d44/html5/thumbnails/15.jpg)
Tankertanker Design
Tankertanker Design
Tankertanker Design
UNF List all the attributes
UNF 1NF 2NF 3NF
Student_Id Student_Name Subject_Code Subject_Name Credit_Hours Grade Address Course Coordinator
![Page 16: 2.0 Relational Data Model_contd](https://reader034.vdocuments.net/reader034/viewer/2022042519/55cf94bb550346f57ba40d44/html5/thumbnails/16.jpg)
Tankertanker Design
Tankertanker Design
Tankertanker Design
1NF
Divide into groups of redundant & irredundant
UNF 1NF 2NF 3NF
Student_Id Student_Name Subject_Code Subject_Name Credit_Hours Grade Address Course Coordinator
Student_Id Student_Name Grade Address Course Coordinator
Student_Id Subject_Code Subject_Name Credit_Hours
![Page 17: 2.0 Relational Data Model_contd](https://reader034.vdocuments.net/reader034/viewer/2022042519/55cf94bb550346f57ba40d44/html5/thumbnails/17.jpg)
Tankertanker Design
Tankertanker Design
Tankertanker Design
2NF Identify Functional Dependencies
UNF 1NF 2NF 3NF
Student_Id Student_Name Subject_Code Subject_Name Credit_Hours Grade Address Course Coordinator
Student_Id Student_Name Grade Address Course Coordinator
Student_Id Student_Name Address Course Coordinator
Student_Id Subject_Code Grade
Student_Id Subject_Code Subject_Name Credit_Hours
Subject_Code Subject_Name Credit_Hours
Functional Dependencies
![Page 18: 2.0 Relational Data Model_contd](https://reader034.vdocuments.net/reader034/viewer/2022042519/55cf94bb550346f57ba40d44/html5/thumbnails/18.jpg)
Tankertanker Design
Tankertanker Design
Tankertanker Design
3NF Identify Transitive Dependencies
UNF 1NF 2NF 3NF
Student_Id Student_Name Subject_Code Subject_Name Credit_Hours Grade Address Course Coordinator
Student_Id Student_Name Grade Address Course Coordinator
Student_Id Student_Name Address Course Coordinator
Student_Id Student_Name Address Course
Student_Id Subject_Code Grade
Student_Id Subject_Code Grade
Student_Id Subject_Code Subject_Name Credit_Hours
Subject_Code Subject_Name Credit_Hours Subject_Code
Subject_Name Credit_Hours
Course Coordinator
Transitive Dependencies
![Page 19: 2.0 Relational Data Model_contd](https://reader034.vdocuments.net/reader034/viewer/2022042519/55cf94bb550346f57ba40d44/html5/thumbnails/19.jpg)
Tankertanker Design
Tankertanker Design
Tankertanker Design
RESULT AFTER
Student_ID Student_ Name Address Course
S0001 Azlina bt Ahmad Sentul Diploma in
Information
Technology
S0144 Amirul bin
Hamdan
Shah Alam Diploma in
Computer Graphic
Design
S0151 Mazlina bt Yakub Shah Alam Associate Diploma
in Interactive
Multimedia
STUDENT
![Page 20: 2.0 Relational Data Model_contd](https://reader034.vdocuments.net/reader034/viewer/2022042519/55cf94bb550346f57ba40d44/html5/thumbnails/20.jpg)
Tankertanker Design
Tankertanker Design
Tankertanker Design
Student_ID Subject_Code Grade
S0001
S0001
S0001
ACT410
ADM101
ART210
A
B
C
S0144
S0144
S0144
ART310
ART230
BUS210
A
B
B
S0151
S0151
S0151
ART410
ART 210
BUS210
C
A
A
STUDENT_SUBJECT
RESULT AFTER
![Page 21: 2.0 Relational Data Model_contd](https://reader034.vdocuments.net/reader034/viewer/2022042519/55cf94bb550346f57ba40d44/html5/thumbnails/21.jpg)
Tankertanker Design
Tankertanker Design
Tankertanker Design
SUBJECT
RESULT AFTER
Subject_Code Subject_Name Credit_Hours
ACT410
ADM101
ART210
Computerised
Accounting
Graphic Design
4
4
4
ART310
ART230
BUS210
Graphic
Communication
Business
Organization
4
2
4
ART410
Promotion Design 4
![Page 22: 2.0 Relational Data Model_contd](https://reader034.vdocuments.net/reader034/viewer/2022042519/55cf94bb550346f57ba40d44/html5/thumbnails/22.jpg)
Tankertanker Design
Tankertanker Design
Tankertanker Design
Course Coordinator
Diploma in Information
Technology
Fazilah
Diploma in Computer
Graphic Design
Ahmad
Associate Diploma in
Interactive Multimedia
Sahada
COURSE
RESULT AFTER