Database Relational Homework help -


the problem "consider relation r 5 attributes abcde. given following dependancies

  1. a->b
  2. bc->e
  3. ed->a

list keys r.

the teacher gave keys, acd,bcd,cde

and need show work them.

the first 2 solved.

for bcd, transitive of 2 3 (bc->e)d->a => bcd->a. and acd id the transitive of 1 4 (bcd), (a->b)cd->a => acd->a

but can't figure out how cde.

so seems did wrong, after googling found answer

  1. methodology find keys: consider attribute sets α containing: a. determinant attributes of f (i.e. a, bc, ed) , b. attributes not contained in determined ones (i.e. c,d). attribute closure algorithm: if α+ superset r α -> r 3 keys: cde, acd, bcd source

from can tell, since c,d not on left side of dependencies. keys left sides cd pre-appended them. can explain me in better detail why?

to keys, start one of dependencies , using inference extend set.

let me have go simple english, can find formal definition net easily.

e.g. start 3).

ed -> 

(knowing e , d, know a)

ed ->ab 

(knowing e , d, know a, knowing a, know b well)

ed->ab 

still, c cannot known, , have used rules except bc->e, add c left hand side, i.e.

cde ->ab 

so, by knowing c,d , e, know a , b well, hence cde key relation abcde. repeat same process, starting other rules until exhausted.


Comments

Popular posts from this blog

how to build hyperlink for query string in php -

php - What is the difference between $_SERVER['PATH_INFO'] and $_SERVER['ORIG_PATH_INFO']? -

queue - mq_receive: message too long -