Welcome to ShenZhenJia Knowledge Sharing Community for programmer and developer-Open, Learning and Share
menu search
person
Welcome To Ask or Share your Answers For Others

Categories

I have been reading up on database design and I am having some difficulty constructing functional dependency diagrams from tables.

I have the following table. Each salesperson is identified by a salesperson’s number, and their sales activities are recorded for each month in the table.

http://i.stack.imgur.com/2NXru.png

I have made the following assumptions:

  • Each Salesperson has a unique salesperson number
  • Each Client has a unique client number
  • Each product has a unique product number and description
  • Each Customer has a unique sales persons that they deal with.

I have come up with the following functional dependencies diagram:

http://i.stack.imgur.com/XFndy.png

My questions are:

  • First of all is this correct way of creating a fd diagram?
  • Is this correct based upon the assumptions?
See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
thumb_up_alt 0 like thumb_down_alt 0 dislike
182 views
Welcome To Ask or Share your Answers For Others

1 Answer

Functional dependencies aren't usually expressed in a diagram. Instead, they're usually expressed like this . . .

A->B
B->CD

or like this.

"Salesperson number" -> "Salesperson name"
"Client number" -> "Client name"

If your diagram means that "Product number" -> "Quantity sold", then your diagram is wrong. Also, client number does not determine product number.


A functional dependency answers the question, "Given one value for A, can I determine one and only one value for B?", where A and B are sets of attributes. Let's look at a simple example.

Given one value for "Product number", can we determine one and only one value for "Product description"? Yes. Given the product number P1023-01, we can determine only one value for "Product description": "A4 Paper". Product number P1023-01 never matches up with any product name but "A4 Paper".

Given one value for "Product number", can we determine one and only one value for "Quantity sold"? No. Given the product number P1023-01, we can determine two different values for "Quantity sold": 6 and 10. The dependency "Product number" -> "Quantity sold" doesn't hold in this relation.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
thumb_up_alt 0 like thumb_down_alt 0 dislike
Welcome to ShenZhenJia Knowledge Sharing Community for programmer and developer-Open, Learning and Share
...