sql - Finding primary key given relation and functional dependencies -


given relation:

competitor(pid, eventname, pname, teamname, teamcoach, eventdate, teamrating)

and functional dependencies:

pid -> pname, teamname, teamcoach  teamname -> teamcoach  eventname -> eventdate  teamname, eventname -> teamrating  

based on knowledge believe primary key {pid, eventname, teamname}

the answer provided says primary key {pid, eventname}

either wrong (which likely) or answer provided wrong.

if tell me right , method of how found it, great.

your answer superkey key , can qualified primary key. however, not best answer. best answer {pid, eventname}. answer not cadiate key.

you can find candidate key finding closure of it. if equals {pid, eventname, pname, teamname, teamcoach, eventdate, teamrating}, candidate key. can find finding closure algorithm in site: http://www.cs.sfu.ca/coursecentral/354/jpei/slides/closuredecomposition.pdf

the closures of {pid, eventname} :  c={pid, eventname}  function: pid -> pname, teamname, teamcoach  c= {pid, eventname, pname, teamname, teamcoach }  function: eventname -> eventdate c={pid, eventname, pname, teamname, teamcoach ,eventdate}  function: teamname, eventname -> teamrating  c={pid, eventname, pname, teamname, teamcoach ,eventdate,teamrating} 

Comments

Popular posts from this blog

javascript - Google App Script ContentService downloadAsFile not working -

javascript - IIFE: var vs this - is there any difference? -

r - Grow a ffdf data frame on disk gradually -