Database Chapter02-03
Database Chapter02-03
Database Application
SAK 3408
CHAPTER 2
DATABASE DESIGN
Data Normalization
3
duplication of data
Well-Structured Relations
4
Recap
5
Requirements:
C++
7/23/200x
Each
Figure 2.24
Steps in
normalization
No multivalued attributes
Every attribute value is atomic
All relations are in 1st Normal
Form
CustID
Date
Items
4/11/02
23
6/11/02
1 Scissor
15
7/11/02
2 Pen, 2 Notebook
7/11/02
23
7/11/02
1 Stapler
8/11/02
Example
12
DEPT_NO
MANAGER_NO
EMP_NO
EMP_NAME
D101
12345
20000
20001
20002
Carl Sagan
Magic Johnson
Larry Bird
D102
13456
30000
30001
Jimmy Carter
Paul Simon
Dept_N
o
Manager_N
o
Emp_N
o
Emp_Name
D101
12345
2000
Carl Sagan
D101
12345
2001
Magic Johnson
D101
12345
2002
Larry Bird
D102
13456
3000
Jimmy Carter
D102
13456
30001
Paul Simon
CourseTitl
e
Nam
e
Dependency
Dependencyon
ononly
onlypart
partofofthe
thekey
key
EmpID, CourseTitle DateCompleted
EmpID Name, DeptName, Salary
EmpID
Nam
e
EmpID
DeptNam Salar
e
y
CourseTitl DateComplete
e
d
2NF PLUS no
transitive
dependencies (one attribute functionally
18
CustID Name
CustID Salesperson
CustID Region
All this is OK
(2nd NF)
19
BUT
20
Salesperson Region
CustID Name
CustID
Salesperson
Now, there are no transitive
dependencies
Both relations are in 3rd NF
21
Boyce-Codd NF
4th NF
No multivalued dependencies
5th NF
No lossless joins
Domain-key NF