Michael Lau
Michael Lau

Reputation: 3

How many Functional Dependency in this relation?

I've been trying to find the FDs for this relation.

Relation X
+---+---+---+---+---+---+
| P | Q | R | S | T | U |
+---+---+---+---+---+---+
| p | c | e | i | k | v |
| p | d | f | j | k | w |
| p | d | g | j | n | y |
| p | d | g | i | n | z |
| q | d | f | i | k | x |
| q | c | g | j | m | y |
+---+---+---+---+---+---+

This is a question in my assignment. Here are my "answer" but I just can't be sure.

S, U --> R  
P, R --> Q, T
P, U --> Q, R, S, T  
Q, U --> P, R, S, T  
T, U --> P, Q, R, S

Am I right or just ridiculously wrong?

Upvotes: 0

Views: 365

Answers (1)

Renzo
Renzo

Reputation: 27424

This kind of task is not so easy to solve by hand, since one has to find all the possible subsets of attributes, to see if a certain subset has always a unique value for another attribute, or set of attributes. In this case, one should check 26 = 64 different combinations to find those that are compatible with the definition of functional dependency.

The most sensible thing is to use a program to find those combinations.

Here is the solution, automatically generated:

U → R S
P R → Q T
Q T → R
R T → Q
P U → Q T
Q R → T
R S → U
R S T → P
T U → P Q
Q U → P T
Q R S → P
Q S T → P U
P S T → Q R U

Of course you can reduce this set by finding a cover with a smaller number of dependencies, like the following one:

U → R S
P R → Q
Q T → R
Q R → T
R T → Q
R S → U
T U → P
P S T → Q

Upvotes: 1

Related Questions