Question

I'm having a hard time visualizing exactly what A->BC means, mainly what exactly BC does.
For example, on a table "If A -> B and B -> C, then A -> C" would look like this, and the statement would be true:

A  |  B  |  C 
1  |  2  |  3 
1  |  2  |  3 

What would A -> BC look like?

How would you show something like "If AB -> C, then A -> BC" is false?

Thanks!

EDIT:
My guess at it is that AB -> C means that C is dependant on both A and B, so the table would look like this:

A  |  B  |  C 
1  |  2  |  3 
1  |  2  |  3 

Or this (which would be a counterexample for my question above):

A  |  B  |  C 
1  |  2  |  4 
1  |  3  |  4 

And both would be true. But this would be false:

A  |  B  |  C 
1  |  2  |  4 
1  |  3  |  5

Is that the right idea?

Was it helpful?

Solution

In case you haven't already read this, it's an okay introduction to functional dependencies. It says:

Union: If X → Y and X → Z, then X → YZ

Decomposition: If X → YZ, then X → Y and X → Z

I find it helpful to read A -> B as "A determines B", and read A -> BC as "A determines B and C". In other words, given an A, you can uniquely determine the value of B and C, but it's not necessarily true that given a B and a C, you can uniquely determine the value of A.

Here's a simple example: a table with at least 3 columns, where A is the primary key and B and C are any other columns:

 id | x | y
------------
 1  | 7 | 4
 2  | 9 | 4
 3  | 7 | 6

To show that If AB -> C, then A -> BC is false, you just have to come up with a single counter-example. Here's one: a table where AB is the primary key (therefore by definition it satisfies AB -> C):

 A | B | C
------------
 1 | 1 | 4
 1 | 2 | 5
 2 | 1 | 6
 2 | 2 | 4

However, it does not satisfy A -> B (because for A=1, B=1,2) and therefore, by Union, it does not satisfy A -> BC. (Bonus points: does it satisfy A -> C? Does it matter?)

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top