The Gateway to Computer Science Excellence
First time here? Checkout the FAQ!
+17 votes

Given the following relation instance.

$$\begin{array}{|l|l|}\hline \text{X} & \text{Y} & \text{Z} \\\hline   \text{1} & \text{4} & \text{2} \\   \text{1} & \text{5} & \text{3} \\  \text{1} & \text{6} & \text{3} \\ \text{3} & \text{2} & \text{2} \\\hline \end{array}$$

Which of the following functional dependencies are satisfied by the instance?

  1. $XY \rightarrow Z$ and $Z \rightarrow Y$
  2. $YZ \rightarrow X$ and $Y \rightarrow Z$
  3. $YZ \rightarrow X$ and $X \rightarrow Z$
  4. $XZ \rightarrow Y$ and $Y \rightarrow X$
asked in Databases by Veteran (52k points)
edited by | 2.5k views

5 Answers

+28 votes
Best answer

(b) is answer.

If $A\to B$ then for each same value of $A$, $B$ value should be same. If all the $A$ values are distinct the FD hold irrespective of the $B$ values.

Since all $Y$ values are distinct FDs with $Y, YX$ and $YZ$ on LHS hold. So, option $B$ is correct. 

In option A, $Z \to Y$ is violated as for same $Z$ value we have different $Y$ values. 
Similarly in C, $X \to Z$ is violated and in D, $XZ \to Y$ is violated.

answered by Active (3.3k points)
edited by
Yes. In (b) a is not repeating and so, FD trivially holds. In all other options, FD condition is easily violated.
+14 votes

Option B is correct.

a functional dependency A \rightarrow B is said to hold if for two tuples t1 and t2 . If for t1[A] = t2[A] then t1[Y] = t2[Y].

Here we can manually check for each option with the given instance and option B satisfies

answered by Boss (11.1k points)
+6 votes

Answer should be (B). 

YZ->X and Y->Z. Here YZ uniquely determines X and Y uniquely determines Z. 


answered by Active (1.7k points)
edited by
0 votes

option b ia right.

answered by Boss (33.9k points)
edited by
–2 votes
Ans: B YZ → X and Y → Z
answered by Loyal (6.9k points)

Related questions

Quick search syntax
tags tag:apple
author user:martin
title title:apple
content content:apple
exclude -tag:apple
force match +apple
views views:100
score score:10
answers answers:2
is accepted isaccepted:true
is closed isclosed:true
49,535 questions
54,117 answers
71,028 users