Mgt
4322 -
Home Spring 2010
Email
to Dr. Lyons
PatLyons Home
[ Calendar10:10 | PortWebsite
| StuWebs | Port1 | 2 |
3 | 4 | 5
| 6 | Showcase
| Presentation
]
[ Ch 1 |
2 | 3 |
4 | 5 |
6 | 7 |
8 | 9 |
10 | 11 | 12 | 13
| 14 || AppDatabase |
Ex1 | 2 |
3 | 4 | 5
| 6 | 7
]
[ HW 1| 2 |
3 | 4 |
| Career1| 2
| 3
] [
SJU
|
TCB |
CareerCtr |
StuInfo |
CareerLinks ] [
SJU Closing ] [H1N1SelfAssessment]
Ch 6 -
Foundations of Business Intelligence: Databases and
Information Management
Database designer's promise - I do solemnly promise that, when designing a database, I shall make every nonkey field depend on the key, the whole key, and nothing but the key, so help me Codd. (The normalization process was first proposed by Edgar F. Codd, see http://en.wikipedia.org/wiki/E.F._Codd.)
Normalization Process
Consider the
Order Record, with fields
*Order #, Date of Order, Customer Name, Customer Address, Product #, Quantity Ordered, Unit Price,
which may contain repeated groups of
Product #, Quantity Ordered, and Unit Price.
Note by PJL(2010Mar4): Unit Price
depends only on Product #, not Order #.
* denotes key.
(Order Record is unnormalized)
*Order #
Date of
Order
Customer
Name
Customer
Address
Product #
Quantity
Ordered
Unit
Price
Product #
Quantity
Ordered
Unit
Price
101
2/4/2007
Davis
22 Elm St.
44
2
1.00
102
2/6/2007
Garcia
14 Oak St.
44
3
1.00
64
4
3.00
103
2/6/2007
Payne
31 Maple St.
37
1
2.00
64
1
3.00
104
2/8/2007
Garcia
14 Oak St.
37
4
2.00
Order Record - *Order #, Date of Order, Customer Name, Customer Address
*Order #
Date of
Order
Customer
Name
Customer
Address
101
2/4/2007
Davis
22 Elm St.
102
2/6/2007
Garcia
14 Oak St.
103
2/6/2007
Payne
31 Maple St.
104
2/8/2007
Garcia
14 Oak St.
*Order #
*Product #
Quantity
Ordered
Unit
Price
101
44
2
1.00
102
44
3
1.00
102
64
4
3.00
103
37
1
2.00
103
64
1
3.00
104
37
4
2.00
To
convert a 1NF record to 2NF, separate the 1NF record into new records,
in which nonkey items are fully dependent on the entire key.
Product Record - *Product #, Unit Price
Order Record - is in 2NF
Sales Record - *Order #, *Product #, Quantity Ordered
*Order #
*Product #
Quantity
Ordered
101
44
2
102
44
3
102
64
4
103
37
1
103
64
1
104
37
4
*Product #
Unit
Price
44
1.00
37
2.00
64
3.00
To
convert a 2NF record to 3NF, separate the 2NF record into new records,
which do not have transitive dependence.
(In Order Record, Customer Address is transitively dependent on the key
only via another nonkey item, Customer Name.)
Sales Record - is in 3NF
Product Record - is in 3NF
Order Record - *Order #, Date of Order, Customer Name
Customer Record - *Customer Name, Customer Address
*Order #
Date of
Order
Customer
Name
101
2/4/2007
Davis
102
2/6/2007
Garcia
103
2/6/2007
Payne
104
2/8/2007
Garcia
*Customer
Name
Customer
Address
Davis
22 Elm St.
Garcia
14 Oak St.
Payne
31
Maple St.
Resulting Database
Order Record - *Order #, Date of Order, Customer Name
Sales Record - *Order #, *Product #, Quantity Ordered
Customer Record - *Customer Name, Customer Address
Product Record - *Product #, Unit Price
References for normalization
-
http://en.wikipedia.org/wiki/Database_normalization,
en.wikipedia.org/wiki/Relation_(mathematics),
support.microsoft.com/kb/283878
Homework Problem: determine the 1NF, 2NF, and 3NF of the
following Student Record, with fields
*StudentID, StudentName, StudentHighSchool, HighSchoolEnrollment,
CourseID, CourseTitle, Grade,
which may contain repeated groups of
CourseID, CourseTitle, and Grade.
* denotes key. (Student Record is unnormalized)
*StudentID
Student
Name
Student
High School
High School
Enrollment
CourseID
Course
Title
Grade
CourseID
Course
Title
Grade
101
Chan
Molloy
2000
3325
OpsMgt
A
102
Hill
StFrancis
3000
2301
IntroMgt
B
3325
OpsMgt
B+
103
Diaz
HolyCross
500
2301
IntroMgt
A-
4322
MIS
B+
104
Lewis
StFrancis
3000
4322
MIS
A
Ensuring Data Quality (p233)
Example (for your info) - the final digit of a Universal Product Code is a check
digit computed as follows:
Add the digits in the odd-numbered positions (first, third, fifth, etc.)
together and multiply by three.
Add the digits in the even-numbered positions (second, fourth, sixth,
etc.) to the result.
Subtract the result from the next-higher multiple of ten. The answer is
the check digit.
For instance, a UPC barcode for a box of tissues is
"03600029145X" where X is the check digit.
X can be calculated by adding the odd-numbered digits
(0+6+0+2+1+5 = 14), multiplying by three (14 × 3 = 42), adding the
even-numbered digits (42+3+0+0+9+4 = 58) and subtracting from the
next-highest multiple of ten (60 - 58 = 2).
The check digit is thus 2 and the full UPC is
036000291452.
This scheme will spot the transposition error of any
two adjacent digits.
See
http://en.wikipedia.org/wiki/Check_digit.
Def - Data Administration - an organizational function for managing an organization's information policy, data planning, and data quality standards (p233).