Title: Part (PartNum, Description, OnHand, Class, Warehouse, Price,
1Part ( PartNum, Description, OnHand, Class,
Warehouse, Price, (OrderNum, OrderDate,
CustomerNum, CustomerName,
RepNum, LastName,
FirstName, NumOrdered,
QuotedPrice )
)
2Part ( PartNum, Description, OnHand, Class,
Warehouse, Price, (OrderNum, OrderDate,
CustomerNum, CustomerName,
RepNum, LastName,
FirstName, NumOrdered,
QuotedPrice )
)
This table is quite meaningful from the user
point of view. It describes the actual
operation---as reflected by the database.
3Part ( PartNum, Description, OnHand, Class,
Warehouse, Price, (OrderNum, OrderDate,
CustomerNum, CustomerName,
RepNum, LastName,
FirstName, NumOrdered,
QuotedPrice )
)
This table is quite meaningful from the user
point of view. It describes the actual
operation---as reflected by the database. But
what if we have a part that has not been ordered
yet?
4Part ( PartNum, Description, OnHand, Class,
Warehouse, Price, (OrderNum, OrderDate,
CustomerNum, CustomerName,
RepNum, LastName,
FirstName, NumOrdered,
QuotedPrice )
)
In that case we need to work on the table and
change it. The structure should be such that
update anomalies are not present. But what if
we have a part that has not been ordered yet?
5Part ( PartNum, Description, OnHand, Class,
Warehouse, Price, (OrderNum, OrderDate,
CustomerNum, CustomerName,
RepNum, LastName,
FirstName, NumOrdered,
QuotedPrice )
)
Lets determine functional dependencies. But
what if we have a part that has not been ordered
yet?
6Part ( PartNum, Description, OnHand, Class,
Warehouse, Price, (OrderNum, OrderDate,
CustomerNum, CustomerName,
RepNum, LastName,
FirstName, NumOrdered,
QuotedPrice )
)
PartNum determines Description OnHand Cla
ss WareHouse Price
7Part ( PartNum, Description, OnHand, Class,
Warehouse, Price, (OrderNum, OrderDate,
CustomerNum, CustomerName,
RepNum, LastName,
FirstName, NumOrdered,
QuotedPrice )
)
PartNum determines Description OnHand Cla
ss WareHouse Price
8Part ( PartNum, Description, OnHand, Class,
Warehouse, Price, (OrderNum, OrderDate,
CustomerNum, CustomerName,
RepNum, LastName,
FirstName, NumOrdered,
QuotedPrice )
)
OrderNum determines OrderDate CustomerNum
9Part ( PartNum, Description, OnHand, Class,
Warehouse, Price, (OrderNum, OrderDate,
CustomerNum, CustomerName,
RepNum, LastName,
FirstName, NumOrdered,
QuotedPrice )
)
OrderNum determines OrderDate CustomerNum
10Part ( PartNum, Description, OnHand, Class,
Warehouse, Price, (OrderNum, OrderDate,
CustomerNum, CustomerName,
RepNum, LastName,
FirstName, NumOrdered,
QuotedPrice )
)
CustomerNum determines CustomerName RepN
um
11Part ( PartNum, Description, OnHand, Class,
Warehouse, Price, (OrderNum, OrderDate,
CustomerNum, CustomerName,
RepNum, LastName,
FirstName, NumOrdered,
QuotedPrice )
)
CustomerNum determines CustomerName RepN
um
12Part ( PartNum, Description, OnHand, Class,
Warehouse, Price, (OrderNum, OrderDate,
CustomerNum, CustomerName,
RepNum, LastName,
FirstName, NumOrdered,
QuotedPrice )
)
CustomerNum determines CustomerName RepN
um which determines LastName FirstNam
e
13Part ( PartNum, Description, OnHand, Class,
Warehouse, Price, (OrderNum, OrderDate,
CustomerNum, CustomerName,
RepNum,
LastName, FirstName,
NumOrdered, QuotedPrice
) )
14Part ( PartNum, Description, OnHand, Class,
Warehouse, Price, (OrderNum, OrderDate,
CustomerNum, CustomerName,
RepNum,
LastName, FirstName,
NumOrdered, QuotedPrice
) )
15Part ( PartNum, Description, OnHand, Class,
Warehouse, Price, (OrderNum, OrderDate,
CustomerNum, CustomerName,
RepNum,
LastName, FirstName,
NumOrdered, QuotedPrice
) )
Theres also (PartNum, OrderNum)
16Part ( PartNum, Description, OnHand, Class,
Warehouse, Price, (OrderNum, OrderDate,
CustomerNum, CustomerName,
RepNum,
LastName, FirstName,
NumOrdered, QuotedPrice
) )
Theres also (PartNum, OrderNum) which
determines NumOrdered
17Part ( PartNum, Description, OnHand, Class,
Warehouse, Price, (OrderNum, OrderDate,
CustomerNum, CustomerName,
RepNum,
LastName, FirstName,
NumOrdered, QuotedPrice
) )
Theres also (PartNum, OrderNum) which
determines NumOrdered and QuotedPrice
18Part ( PartNum, Description, OnHand, Class,
Warehouse, Price, (OrderNum, OrderDate,
CustomerNum, CustomerName,
RepNum,
LastName, FirstName,
NumOrdered, QuotedPrice
) )
So now what do we do?
19Part ( PartNum, Description, OnHand, Class,
Warehouse, Price, (OrderNum, OrderDate,
CustomerNum, CustomerName,
RepNum,
LastName, FirstName,
NumOrdered, QuotedPrice
) )
1. Normalize the table (it has repeating groups).
20Part ( PartNum, Description, OnHand, Class,
Warehouse, Price, (OrderNum, OrderDate,
CustomerNum, CustomerName,
RepNum,
LastName, FirstName,
NumOrdered, QuotedPrice
) )
1. Normalize the table (it has repeating
groups). 2. Eliminate partial dependencies.
21Part ( PartNum, Description, OnHand, Class,
Warehouse, Price, (OrderNum, OrderDate,
CustomerNum, CustomerName,
RepNum,
LastName, FirstName,
NumOrdered, QuotedPrice
) )
1. Normalize the table (it has repeating
groups). 2. Eliminate partial dependencies. 3.
Make sure the only determinants are candidate
keys.
22Part ( PartNum, Description, OnHand, Class,
Warehouse, Price, OrderNum, OrderDate,
CustomerNum, CustomerName,
RepNum,
LastName, FirstName,
NumOrdered, QuotedPrice
)
1. Normalize the table (it has repeating
groups). 2. Eliminate partial dependencies. 3.
Make sure the only determinants are candidate
keys.
23Parts (PartNum, Description, OnHand, Class,
Wartehouse, Price)
Part ( PartNum, OrderNum, OrderDate,
CustomerNum, CustomerName,
RepNum,
LastName, FirstName,
NumOrdered, QuotedPrice
)
1. Normalize the table (it has repeating
groups). 2. Eliminate partial dependencies. 3.
Make sure the only determinants are candidate
keys.
24Parts (PartNum, Description, OnHand, Class,
Wartehouse, Price)
Part ( PartNum, OrderNum, OrderDate,
CustomerNum, CustomerName,
RepNum,
LastName, FirstName,
) OrderLine (PartNum, OrderNum, NumOrdered,
QuotedPrice)
1. Normalize the table (it has repeating
groups). 2. Eliminate partial dependencies. 3.
Make sure the only determinants are candidate
keys.
25Parts (PartNum, Description, OnHand, Class,
Wartehouse, Price)
Part ( PartNum, OrderNum, OrderDate,
CustomerNum, CustomerName,
RepNum,
) Rep (RepNum,
LastName, FirstName) OrderLine (PartNum,
OrderNum, NumOrdered, QuotedPrice)
1. Normalize the table (it has repeating
groups). 2. Eliminate partial dependencies. 3.
Make sure the only determinants are candidate
keys.
26Parts (PartNum, Description, OnHand, Class,
Wartehouse, Price)
Part ( PartNum, OrderNum, OrderDate,
CustomerNum,
) Customer (CustomerNum, CustomerName, RepNum)
Rep (RepNum, LastName, FirstName) OrderLine
(PartNum, OrderNum, NumOrdered, QuotedPrice)
1. Normalize the table (it has repeating
groups). 2. Eliminate partial dependencies. 3.
Make sure the only determinants are candidate
keys.
27Parts (PartNum, Description, OnHand, Class,
Wartehouse, Price)
Part ( PartNum, OrderNum, OrderDate,
CustomerNum,
) Customer (CustomerNum, CustomerName, RepNum)
Rep (RepNum, LastName, FirstName) OrderLine
(PartNum, OrderNum, NumOrdered, QuotedPrice)
1. Normalize the table (it has repeating
groups). 2. Eliminate partial dependencies. 3.
Make sure the only determinants are candidate
keys.
28Parts (PartNum, Description, OnHand, Class,
Wartehouse, Price)
Orders ( OrderNum, OrderDate,
CustomerNum,
) Customer (CustomerNum, CustomerName, RepNum)
Rep (RepNum, LastName, FirstName) OrderLine
(PartNum, OrderNum, NumOrdered, QuotedPrice)
1. Normalize the table (it has repeating
groups). 2. Eliminate partial dependencies. 3.
Make sure the only determinants are candidate
keys.
29Parts (PartNum, Description, OnHand, Class,
Wartehouse, Price)
Orders (OrderNum, OrderDate, CustomerNum
) Customer (CustomerNum, CustomerName,
RepNum) Rep (RepNum, LastName, FirstName)
OrderLine (PartNum, OrderNum, NumOrdered,
QuotedPrice)
30Parts (PartNum, Description, OnHand, Class,
Wartehouse, Price)
Orders (OrderNum, OrderDate, CustomerNum
) Customer (CustomerNum, CustomerName,
RepNum) Rep (RepNum, LastName, FirstName)
OrderLine (PartNum, OrderNum, NumOrdered,
QuotedPrice)
31Parts (PartNum, Description, OnHand, Class,
Wartehouse, Price)
Orders (OrderNum, OrderDate, CustomerNum ) End
of story Customer (CustomerNum, CustomerName,
RepNum) Rep (RepNum, LastName, FirstName)
OrderLine (PartNum, OrderNum, NumOrdered,
QuotedPrice)
32Second problem (Henry Books Case Problem One)
33Using the types of entities found in the Henry
Books database (books, authors, publishers),
create an example of a table that is in first
normal form but not in second normal form and an
example of a table that is in second normal form
but not in third normal form. In each case,
justify your answer
34Using the types of entities found in the Henry
Books database (books, authors, publishers),
create an example of a table that is in first
normal form but not in second normal form and an
example of a table that is in second normal form
but not in third normal form. In each case,
justify your answer
This is an example about the power of assumptions.
35Using the types of entities found in the Henry
Books database (books, authors, publishers),
create an example of a table that is in first
normal form but not in second normal form and an
example of a table that is in second normal form
but not in third normal form. In each case,
justify your answer
This is an example about the power of assumptions.
Take this table (ISBN, AuthorSSN, AuthorName)
36Using the types of entities found in the Henry
Books database (books, authors, publishers),
create an example of a table that is in first
normal form but not in second normal form and an
example of a table that is in second normal form
but not in third normal form. In each case,
justify your answer
This is an example about the power of assumptions.
Take this table (ISBN, AuthorSSN, AuthorName)
If we assume that a book can only have one author
(that's pretty restrictive, but think about
semester projects where group work is not
allowed) then the above table is in 2NF already
(ISBN is the key) but not in 3NF because of
AuthorSSN being a non-key determinant (of whom?)
37Using the types of entities found in the Henry
Books database (books, authors, publishers),
create an example of a table that is in first
normal form but not in second normal form and an
example of a table that is in second normal form
but not in third normal form. In each case,
justify your answer
This is an example about the power of assumptions.
Take this table (ISBN, AuthorSSN, AuthorName)
If we relax the requirement, and allow
co-authors, then the table is no longer in 2NF.
That's because we need to include the AuthorSSN
column in the key and the functional dependency
(AuthorSSN
AuthorName) becomes a partial dependency it was
about the existence of non-key determinants in
the other context
38Part (PartNum, Description, OnHand, Class,
Warehouse, Price, (OrderNum, OrderDate,
CustomerNum, CustomerName,
RepNum, LastName,
FirstName, NumOrdered,
QuotedPrice )
)
39Part ( PartNum, Description, OnHand, Class,
Warehouse, Price, OrderNum, OrderDate,
CustomerNum, CustomerName,
RepNum, LastName,
FirstName, NumOrdered,
QuotedPrice )
40Part ( PartNum, Description, OnHand, Class,
Warehouse, Price, OrderNum, OrderDate,
CustomerNum, CustomerName,
RepNum, LastName,
FirstName, NumOrdered,
QuotedPrice )
41Part ( PartNum, Description, OnHand, Class,
Warehouse, Price, OrderNum, OrderDate,
CustomerNum, CustomerName,
RepNum
NumOrdered, QuotedPrice
) Rep (RepNum, LastName,
FirstName)
42Part ( PartNum, Description, OnHand, Class,
Warehouse, Price, OrderNum, OrderDate,
CustomerNum, CustomerName,
RepNum
NumOrdered, QuotedPrice
) Rep (RepNum, LastName, FirstName)
43Part ( PartNum, Description, OnHand, Class,
Warehouse, Price, OrderNum, OrderDate,
CustomerNum, CustomerName
NumOrdered, QuotedPrice
) Customer (CustomerName, RepNum) Rep
(RepNum, LastName, FirstName)
44Part ( PartNum, Description, OnHand, Class,
Warehouse, Price, OrderNum, OrderDate,
CustomerNum,
NumOrdered,
QuotedPrice ) Customer
(CustomerName, RepNum) Rep (RepNum, LastName,
FirstName)
45Part ( PartNum, Description, OnHand, Class,
Warehouse, Price, OrderNum,
NumOrdered, QuotedPrice
) Orders (OrderNum, OrderDate,
CustomerNum) Customer (CustomerName, RepNum)
Rep (RepNum, LastName, FirstName)
46Part ( PartNum, OrderNum,
NumOrdered, QuotedPrice
) Parts (PartNum, Description,
OnHand, Class, Warehouse, Price) Orders
(OrderNum, OrderDate, CustomerNum) Customer
(CustomerName, RepNum) Rep (RepNum, LastName,
FirstName)
47Part ( PartNum, OrderNum,
NumOrdered, QuotedPrice
) Parts (PartNum, Description,
OnHand, Class, Warehouse, Price) Orders
(OrderNum, OrderDate, CustomerNum) Customer
(CustomerName, RepNum) Rep (RepNum, LastName,
FirstName)
48OrderLine ( PartNum, OrderNum,
NumOrdered, QuotedPrice
) Parts (PartNum, Description,
OnHand, Class, Warehouse, Price) Orders
(OrderNum, OrderDate, CustomerNum) Customer
(CustomerName, RepNum) Rep (RepNum, LastName,
FirstName)
49OrderLine ( PartNum, OrderNum, NumOrdered,
QuotedPrice) Parts (PartNum, Description,
OnHand, Class, Warehouse, Price) Orders
(OrderNum, OrderDate, CustomerNum) Customer
(CustomerName, RepNum) Rep (RepNum, LastName,
FirstName)