10,319 views
40 40 votes

Consider a relation R with five attributes $V, W, X, Y,$ and $Z.$ The following functional dependencies hold:

$VY→ W, WX → Z,$ and $ZY → V.$

Which of the following is a candidate key for $R?$

  1. $VXZ$
  2. $VXY$
  3. $VWXY$
  4. $VWXYZ$

3 Answers

Best answer
44 44 votes

As we can see attributes  $X$ and $Y$ do not appear in the RHS of any FD and so they need to be part of any super/candidate key. So, candidate keys are: $VXY, WXY, ZXY$ as these three can determine any other attribute where as a proper subset of any of them cannot determine all other attributes.

$VXZ$ is not a super key as $Y$ is not there where as $VWXY$ and $VWXYZ$ are super keys but since their proper subsets are also super keys they are not candidate keys.

The answer is B.

• edited by
6 6 votes
As we can see that w z and v can be generated from the given functional dependencies and there is no way we can generate X and Y therefore X and Y must be the part of candidate key: so, xy+ = xy & vxy + = vxywz So it turns out vxy is the key, ie. option (b) and so option c and d are super keys.
0 0 votes

Given Relation Schema R(V, W, X, Y, Z)

VY---->W

WX---->Z

ZY---->V

Short Trick= The attributes which are not present on RHS of a relation are part of Candidate Keys 

here WZV present on R.H.S of a Relation but X,Y not present on R.H.S So XY Must be part of CK.

Find Closure of XY = XY     

Since From XY we cannot find all attributes so check remaining attributes with XY 

  •  Closure of XYV = XYVWZ           All Attributes came from XYV So it is CK

  • Closure of XYW = XYWZV          All Attributes came from XYW So it is CK

  • Closure of XYZ =XYZVW                           All Attributes came from XYZ So it is CK

Dont check with 4 attributes bec 4 atributes are superset of above CK So they are not CK

Now check option

a-  VXZ    WRONG        XY not present here 

b-   VXY   RIGHT 

c-  VWXY   WRONG                 it is SK not CK

d-   VWXYZ     WRONG               it is SK not CK

Answer:
Position:
Show:

Related questions

115 115 votes
11 answers 11 answers
38.9k
38.9k views
Ishrat Jahan asked Nov 1, 2014
38,900 views
Consider a database with three relation instances shown below. The primary keys for the Drivers and Cars relation are did and cid respectively and the records are stored ...
31 31 votes
5 answers 5 answers
7.2k
7.2k views
Ishrat Jahan asked Nov 1, 2014
7,204 views
Consider a database with three relation instances shown below. The primary keys for the Drivers and Cars relation are did and cid respectively and the records are stored ...
44 44 votes
2 answers 2 answers
12.5k
12.5k views
Ishrat Jahan asked Nov 1, 2014
12,536 views
In a database file structure, the search key field is $9$ $bytes$ long, the block size is $512$ $bytes$, a record pointer is $7$ $bytes$ and a block pointer is $6$ $bytes...
59 59 votes
5 answers 5 answers
29.4k
29.4k views
Ishrat Jahan asked Oct 31, 2014
29,423 views
Consider the relations $r_{1}\text{(P, Q, R)}$ and $r_{2}\text{(R, S, T)}$ with primary keys $\text{P}$ and $\text{R}$ respectively. The relation $r_{1}$ contains $2000$ ...