Discussion One

Part (
PartNum,
Description, OnHand, Class, Warehouse, Price,
(OrderNum, OrderDate, CustomerNum, CustomerName,
RepNum, LastName, FirstName,
NumOrdered,
QuotedPrice
)
)
Part (
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.
Part (
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?
Part (
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?
Part (
PartNum,
Description, OnHand, Class, Warehouse, Price,
(OrderNum, OrderDate, CustomerNum, CustomerName,
RepNum, LastName, FirstName,
NumOrdered,
QuotedPrice
)
)
Let’s determine functional dependencies.
But what if we have a part that has not been ordered yet?
Part (
PartNum,
Description, OnHand, Class, Warehouse, Price,
(OrderNum, OrderDate, CustomerNum, CustomerName,
RepNum, LastName, FirstName,
NumOrdered,
QuotedPrice
)
)
PartNum determines:
Description
OnHand
Class
WareHouse
Price
Part (
PartNum,
Description, OnHand, Class, Warehouse, Price,
(OrderNum, OrderDate, CustomerNum, CustomerName,
RepNum, LastName, FirstName,
NumOrdered,
QuotedPrice
)
)
PartNum determines:
Description
OnHand
Class
WareHouse
Price
Part (
PartNum,
Description, OnHand, Class, Warehouse, Price,
(OrderNum, OrderDate, CustomerNum, CustomerName,
RepNum, LastName, FirstName,
NumOrdered,
QuotedPrice
)
)
OrderNum determines:
OrderDate
CustomerNum
Part (
PartNum,
Description, OnHand, Class, Warehouse, Price,
(OrderNum, OrderDate, CustomerNum, CustomerName,
RepNum, LastName, FirstName,
NumOrdered,
QuotedPrice
)
)
OrderNum determines:
OrderDate
CustomerNum
Part (
PartNum,
Description, OnHand, Class, Warehouse, Price,
(OrderNum, OrderDate, CustomerNum, CustomerName,
RepNum, LastName, FirstName,
NumOrdered,
QuotedPrice
)
)
CustomerNum determines:
CustomerName
RepNum
Part (
PartNum,
Description, OnHand, Class, Warehouse, Price,
(OrderNum, OrderDate, CustomerNum,
CustomerName,
RepNum, LastName, FirstName,
NumOrdered,
QuotedPrice
)
)
CustomerNum determines:
CustomerName
RepNum
Part (
PartNum,
Description, OnHand, Class, Warehouse, Price,
(OrderNum, OrderDate, CustomerNum,
CustomerName,
RepNum, LastName, FirstName,
NumOrdered,
QuotedPrice
)
)
CustomerNum determines:
CustomerName
RepNum which determines
LastName
FirstName
Part (
PartNum,
Description, OnHand, Class, Warehouse, Price,
(OrderNum, OrderDate, CustomerNum,
CustomerName,
RepNum,
LastName,
FirstName,
NumOrdered,
QuotedPrice
)
)
Part (
PartNum,
Description, OnHand, Class, Warehouse, Price,
(OrderNum, OrderDate, CustomerNum,
CustomerName,
RepNum,
LastName,
FirstName,
NumOrdered,
QuotedPrice
)
)
Part (
PartNum,
Description, OnHand, Class, Warehouse, Price,
(OrderNum, OrderDate, CustomerNum,
CustomerName,
RepNum,
LastName,
FirstName,
NumOrdered,
QuotedPrice
)
)
There’s also (PartNum, OrderNum)
Part (
PartNum,
Description, OnHand, Class, Warehouse, Price,
(OrderNum, OrderDate, CustomerNum,
CustomerName,
RepNum,
LastName,
FirstName,
NumOrdered,
QuotedPrice
)
)
There’s also (PartNum, OrderNum) which determines
NumOrdered
Part (
PartNum,
Description, OnHand, Class, Warehouse, Price,
(OrderNum, OrderDate, CustomerNum,
CustomerName,
RepNum,
LastName,
FirstName,
NumOrdered,
QuotedPrice
)
)
There’s also (PartNum, OrderNum) which determines
NumOrdered and
QuotedPrice
Part (
PartNum,
Description, OnHand, Class, Warehouse, Price,
(OrderNum, OrderDate, CustomerNum,
CustomerName,
RepNum,
LastName,
FirstName,
NumOrdered,
QuotedPrice
)
)
So now what do we do?
Part (
PartNum,
Description, OnHand, Class, Warehouse, Price,
(OrderNum, OrderDate, CustomerNum,
CustomerName,
RepNum,
LastName,
FirstName,
NumOrdered,
QuotedPrice
)
)
1. Normalize the table (it has repeating groups).
Part (
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.
Part (
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.
Part (
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.
Parts (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.
Parts (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.
Parts (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.
Parts (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.
Parts (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.
Parts (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.
Parts (PartNum, Description, OnHand, Class, Wartehouse, Price)
Orders (OrderNum, OrderDate, CustomerNum )
Customer (CustomerNum, CustomerName, RepNum)
Rep (RepNum, LastName, FirstName)
OrderLine (PartNum, OrderNum, NumOrdered, QuotedPrice)
Parts (PartNum, Description, OnHand, Class, Wartehouse, Price)
Orders (OrderNum, OrderDate, CustomerNum )
Customer (CustomerNum, CustomerName, RepNum)
Rep (RepNum, LastName, FirstName)
OrderLine (PartNum, OrderNum, NumOrdered, QuotedPrice)
Parts (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)
Second problem: (Henry Books Case Problem One)
Using 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…
Using 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.
Using 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)
Using 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?)
Using 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
Part (PartNum, Description, OnHand, Class, Warehouse, Price,
(OrderNum, OrderDate, CustomerNum, CustomerName,
RepNum, LastName, FirstName,
NumOrdered,
QuotedPrice
)
)
Part ( PartNum,
Description, OnHand, Class, Warehouse, Price,
OrderNum, OrderDate, CustomerNum,
CustomerName,
RepNum,
LastName,
FirstName,
NumOrdered,
QuotedPrice
)
Part ( PartNum,
Description, OnHand, Class, Warehouse, Price,
OrderNum, OrderDate, CustomerNum,
CustomerName,
RepNum,
LastName,
FirstName,
NumOrdered,
QuotedPrice
)
Part ( PartNum,
Description, OnHand, Class, Warehouse, Price,
OrderNum, OrderDate, CustomerNum,
CustomerName,
RepNum
NumOrdered,
QuotedPrice
)
Rep (RepNum, LastName, FirstName)
Part ( PartNum,
Description, OnHand, Class, Warehouse, Price,
OrderNum, OrderDate, CustomerNum,
CustomerName,
RepNum
NumOrdered,
QuotedPrice
)
Rep (RepNum, LastName, FirstName)
Part ( PartNum,
Description, OnHand, Class, Warehouse, Price,
OrderNum, OrderDate, CustomerNum,
CustomerName
NumOrdered,
QuotedPrice
)
Customer (CustomerName, RepNum)
Rep (RepNum, LastName, FirstName)
Part ( PartNum,
Description, OnHand, Class, Warehouse, Price,
OrderNum, OrderDate, CustomerNum,
NumOrdered,
QuotedPrice
)
Customer (CustomerName, RepNum)
Rep (RepNum, LastName, FirstName)
Part ( PartNum,
Description, OnHand, Class, Warehouse, Price,
OrderNum,
NumOrdered,
QuotedPrice
)
Orders (OrderNum, OrderDate, CustomerNum)
Customer (CustomerName, RepNum)
Rep (RepNum, LastName, FirstName)
Part ( PartNum,
OrderNum,
NumOrdered,
QuotedPrice
)
Parts (PartNum, Description, OnHand, Class, Warehouse, Price)
Orders (OrderNum, OrderDate, CustomerNum)
Customer (CustomerName, RepNum)
Rep (RepNum, LastName, FirstName)
Part ( PartNum,
OrderNum,
NumOrdered,
QuotedPrice
)
Parts (PartNum, Description, OnHand, Class, Warehouse, Price)
Orders (OrderNum, OrderDate, CustomerNum)
Customer (CustomerName, RepNum)
Rep (RepNum, LastName, FirstName)
OrderLine ( PartNum,
OrderNum,
NumOrdered,
QuotedPrice
)
Parts (PartNum, Description, OnHand, Class, Warehouse, Price)
Orders (OrderNum, OrderDate, CustomerNum)
Customer (CustomerName, RepNum)
Rep (RepNum, LastName, FirstName)
OrderLine ( PartNum, OrderNum, NumOrdered, QuotedPrice)
Parts (PartNum, Description, OnHand, Class, Warehouse, Price)
Orders (OrderNum, OrderDate, CustomerNum)
Customer (CustomerName, RepNum)
Rep (RepNum, LastName, FirstName)