3

I'm currently taking the course on DB and the theme is Relational Design Theory. Sub-theme is Multivalued dependencies and I'm completely lost in them :(

I have such a question:

R(A,B,C):
A | B | C
----------
1 | 2 | 3
1 | 3 | 2
1 | 2 | 2
3 | 2 | 1
3 | 2 | 3

Which of the following multivalued dependencies does this instance of R not satisfy?

1. AB ↠ C 
2. B ↠ C 
3. C ↠ A 
4. BC ↠ C

I know that:

A | B  | rest
----------
a | b1 | r1
a | b2 | r2
a | b1 | r2
a | b2 | r1

I'm making tables for those dependencies in those manner:

B ↠ C

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

According to my assumptions: 2 2 1 and 2 1 3 are at rule above, so there also should be 2 1 1 and 2 2 3 records.

So this one is not correct. Am I right?

And I don't have any idea how to build such table for AB ↠ C. It will be the same table?

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

Is it something that called trivial dependency?

manlio
  • 18,345
  • 14
  • 76
  • 126
Viacheslav Kondratiuk
  • 8,493
  • 9
  • 49
  • 81

1 Answers1

0

Let me stretch my mind back to college days, from my Database Modeling Concepts class... Taking a quick refresher course via some online PDFs...

I wrote and rewrote a paragraph here to try to concisely explain the multidetermines operator, but I can't explain it any more clearly than the PDF above. Roughly speaking, if B ↠ C, then for every (B, C, A) tuple that exists, you can swap out any C value in (B, C) in R and still find a tuple in R.

In the case of your last question, you're right. I don't remember the proper term, but since there are no other columns than A, B, C, then AB ↠ C is trivially satisfied in R. To build a table for it, I'd order by A first, then B. It would look something like

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

B ↠ C is a much more interesting example. Since the (B, C, A) tuples (2, 3, 1) and (2, 1, 3) both exist, the tuples (2, 1, 1) and (2, 3, 3) (obtained by swapping C) must both exist to satisfy R. Since (2, 1, 1) does not exist, it does not satisfy R. Writing out the tables like you did makes it quite easy to see.

If you see the examples in the PDF I linked earlier, it puts meaningful names to the columns, which may aid in your understanding. I hope this sets you on the right path!

xathien
  • 812
  • 7
  • 10