|
Fall Semester 2003
|
Lecture Notes Fourteen:
Chapter Six, Homework Five (Part One)
Today in class we
- briefly summarize Chapter Six and then
- discuss the first part of Homework Five
This second part I summarize here.
The Lab Notes for tomorrow will look at the rest of the assignment.
Premiere Products Exercises
1. There a number of things we need to take into account:
- We need to start from the existing design of Premiere Products.
- If we don't know the existing design it's going to be extremely difficult.
- So, where's the design, what page in the book.
- The answer my friends is in the blowing of the wind: it starts on page 178.
- So what does this problem want?
- It asks that reps no longer be at most one per customer.
- That is, a customer could be represented by more than one rep.
- But that list is known.
- So we need to take a column out of the
Customer table.
- But we also need a table for a many-to-many relationship between customers and reps.
- Besides these two changes we need to keep another thing in mind.
- When a customer places an order a certain sales rep will get the commission.
- This sales rep must be from the known list of reps associated with the customer.
- So we must add a column to the
Orders table.
- Moreover we have a composite foreign key in that table to enforce referential integrity.
2. We again need to keep a few things in mind:
- We start from the original design of Premiere Products, described on pages 178-185.
- Don't think that you should build on the changes from the previous exercises.
- The exercises are independent, so we start from the Original Premiere Products design, again.
- And the situation we need to accomodate this time around is the total
lack of relationship between reps and customers.
- Then, we start in the same way: take the
RepNum out of Customer.
- You see, you might have to record more than one.
- And with the current layout there's no room for more than one.
- But since there is no relationship, we don't need to build another table.
- And the only one other thing we need to do is to extend the
Orders table.
- With what? (I am sure you know it.) (Select to highlight).
3. Now they ask us to refer to User View 3. Which User View 3? That's where we start:
- If we don't know which User View 3 they speak of etc. Page is 182.
- Is this right or wrong? Or is it 187. Think about it.
- The new thing here is that a Part could be stored in more than one Warehouse.
- So there are two ways of approaching it and they both yield the same result.
- Method one says: there's a repeating group in the Part table.
- That repeating group is identifying a Warehouse and a number OnHand.
- That's for each PartNum.
- So turn it in 1NF, etc.
- You end up with a many-to-many relationship between Parts and Warehouses.
- The other method says: there should be a repeating group in the Warehouse table.
- That repeating groups is identifying a PartNum and a quantity OnHand repeatedly.
- So we normalize, etc.
- The result is the same, only the order of the columns is a bit changed.
- As discussed in class Description stays in Warehouse.
- Moving it in the relationship would break 2NF.
- But I agree that the text might be a bit misleading at first.
These are all the comments we post to help with Homework Five.
In class we will discuss these at length.
Please use DBDL (and E-R for more points) to communicate your designs.
The Lab Notes of tomorrow will focus on the remaining two problems.
(That's Henry Books Case on pages 218-219).
See you tomorrow in lab!
Last updated: Sep 26, 2003 by Adrian German for A114/I111