| |
Welcome to the dBforums forums.
You are currently viewing our boards as a guest which gives you limited access to view most discussions, articles and access our other FREE features. By joining our free community you will have access to post topics, communicate privately with other members (PM), respond to polls, upload your own photos and access many other special features. Registration is fast, simple and absolutely free so please, join our community today!
If you have any problems with the registration process or your account login, please contact contact support.
If you prefer not to see double-underlined words and corresponding ads, place your cursor here for ContentLink opt out.
|
 |

10-03-07, 00:19
|
|
Registered User
|
|
Join Date: Oct 2007
Posts: 2
|
|
|
What is the difference between a functional dependency and a multivalued dependency?
|
I am reading both definitions, but it's hard to differentiate. It appears a functional dependency is when one value is based on a similar concept as another value, and if you know one, you probably also know the other. I don't get how this is different from a multivalued dependency, which seems to have a similar definition.
Can someone point out to me where the two definitions contrast each other?
|
Last edited by austin2359 : 10-03-07 at 00:26.
|

10-03-07, 07:25
|
|
SQL Consultant
|
|
Join Date: Apr 2002
Location: Toronto, Canada
Posts: 13,556
|
|
functional dependency: Given a relation R, a set of attributes X in R is said to functionally determine another attribute Y, also in R, (written X → Y) iff each X value is associated with precisely one Y value.
in other words, Y is dependent on X
in practical terms: give me a value of X, and i can tell you the value of Y that corresponds to it
Code:
SELECT Y FROM daTable WHERE X = 42
functional dependency plays an important part in determining whether a table is in 2NF
so far so good?
multivalued dependency is trickier and comes into play only for 4NF
the wikipedia Course/Book/Lecturer example is actually pretty good, if you can see past the greek script
|
|

10-03-07, 23:55
|
|
Gives Bad Advice
|
|
Join Date: Mar 2007
Location: 010101010110100
Posts: 706
|
|
|
I have also wondered the same thing Rudy. Take your quote here:
Quote:
|
Originally Posted by r937
in practical terms: give me a value of X, and i can tell you the value of Y that corresponds to it
|
Keeping that in mind, when I am personally trying to find a FD I have a problem because "to what degree" do you go to answer that question.
For example, if I have a table with the following attributes
vin
license_Plate
If I ask myself "if I know the value of the license plate, can I get the vin?" I see two possibilities for the answer.
1. The answer should be yes because the vin is associated with that plate in the department of motor vehicle database and using that external source, one could easily find out the info.
2. The answer should be no because without the dmv database one would not know what matches what.
So, to what degree or how far can a person go in answering that question? Are external sources taken into consideration as in my example?
Sorry if I am not clear but it is a little confusing and open to interpretation.
Thanks
__________________
I and many others around the world are of the strong belief that the universe was created by the Flying Spaghetti Monster. It was He who created all that we see and all that we feel. We feel strongly that the overwhelming scientific evidence pointing towards evolutionary processes is nothing but a coincidence, put in place by Him.
|
|

10-04-07, 07:33
|
|
SQL Consultant
|
|
Join Date: Apr 2002
Location: Toronto, Canada
Posts: 13,556
|
|
try not to extend the rule to the general world, but instead, apply it only to the data in the table
foo bar
103 asdf
105 qwer
106 fghj
103 sdfg
105 ghjk
now ask yourself: given a value of foo, can you tell me the corresponding value of bar? if the answer is yes, then bar is functionally dependent on foo
|
|

10-04-07, 07:58
|
|
Gives Bad Advice
|
|
Join Date: Mar 2007
Location: 010101010110100
Posts: 706
|
|
Thanks, that clears it up for me. That will come in very handy.
In one of my tables dealing with vehicles, I have seperated the vin thinking that there may have been a FD between the vin and plate.
If one is in doubt, would it be better to seperate the field from the table (to err on the side of caution) or would that be foolhardy? Sometimes, it is not really clear as to what may be a FD or not.
__________________
I and many others around the world are of the strong belief that the universe was created by the Flying Spaghetti Monster. It was He who created all that we see and all that we feel. We feel strongly that the overwhelming scientific evidence pointing towards evolutionary processes is nothing but a coincidence, put in place by Him.
|
|

10-04-07, 08:04
|
|
SQL Consultant
|
|
Join Date: Apr 2002
Location: Toronto, Canada
Posts: 13,556
|
|
i'm sorry, i don't understand "separate the field from the table"
|
|

10-04-07, 08:14
|
|
Gives Bad Advice
|
|
Join Date: Mar 2007
Location: 010101010110100
Posts: 706
|
|
Well, when there is a FD, the way to solve it is by removing the determinate.
So for X -> Y you would remove X to remove the FD. Correct? That was what I meant by seperate the field. 
__________________
I and many others around the world are of the strong belief that the universe was created by the Flying Spaghetti Monster. It was He who created all that we see and all that we feel. We feel strongly that the overwhelming scientific evidence pointing towards evolutionary processes is nothing but a coincidence, put in place by Him.
|
|

10-04-07, 08:16
|
|
SQL Consultant
|
|
Join Date: Apr 2002
Location: Toronto, Canada
Posts: 13,556
|
|
sorry, frank, i have no idea what you're on about
typically FDs are discussed in terms of candidate keys
why would you want to remove the key?
can you give example data, the way i did in post #4?
oh, and you don't "solve" functional dependencies, you *want* functional dependencies when you're modelling
|
|

10-04-07, 08:39
|
|
Gives Bad Advice
|
|
Join Date: Mar 2007
Location: 010101010110100
Posts: 706
|
|
Rudy, I think I may possibly have my terminlogy mixed up. I think I may be talking about a transitive dependancies. The way that I understand 3NF, all of the transitive dependancies have to be removed from my table in order to achive 3NF.
Is it possible that I am confusing the terms? The reason I think I am confusing these two terms is after you said that you want FD in a table, it made me think of 2NF where everything must be dependant on the whole key, and that is a good thing.
Am I incorrect?
__________________
I and many others around the world are of the strong belief that the universe was created by the Flying Spaghetti Monster. It was He who created all that we see and all that we feel. We feel strongly that the overwhelming scientific evidence pointing towards evolutionary processes is nothing but a coincidence, put in place by Him.
|
|

10-04-07, 08:43
|
|
SQL Consultant
|
|
Join Date: Apr 2002
Location: Toronto, Canada
Posts: 13,556
|
|
no you aren't
if you look back at post #2, i did mention that FD plays a role in 2NF
each column must be functionally dependent on the entire key
|
|

10-04-07, 08:52
|
|
Gives Bad Advice
|
|
Join Date: Mar 2007
Location: 010101010110100
Posts: 706
|
|
Ok. cool. In post #3, I was actually talking about finding a transitive dependancy. Rudy, would you please tell me if what I am asking in #3 still applies? Would I still exclude outside sources when trying to resolve a TD?
__________________
I and many others around the world are of the strong belief that the universe was created by the Flying Spaghetti Monster. It was He who created all that we see and all that we feel. We feel strongly that the overwhelming scientific evidence pointing towards evolutionary processes is nothing but a coincidence, put in place by Him.
|
|

10-04-07, 13:31
|
|
SQL Consultant
|
|
Join Date: Apr 2002
Location: Toronto, Canada
Posts: 13,556
|
|
gotta be honest, i didn't understand that vin/plate stuff in post #3, but generally speaking, you would do modelling based not on what data is available in the external world, but on the data in your application
|
|
| Thread Tools |
Search this Thread |
|
|
|
| Display Modes |
Linear Mode
|
Posting Rules
|
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is Off
|
|
|
|
|