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

Consider a relation scheme $R = (A, B, C, D, E, H)$ on which the following functional dependencies hold: {$A \rightarrow B$, $BC \rightarrow D$, $E \rightarrow C$, $D \rightarrow A$}. What are the candidate keys R?

  1. $AE, BE$
  2. $AE, BE, DE$
  3. $AEH, BEH, BCH$
  4. $AEH, BEH, DEH$
asked in Databases by Veteran (59.7k points)
edited by | 1.6k views

2 Answers

+25 votes
Best answer

using the given functional dependencies and looking at the dependent attributes, E and H are not dependent on any. So, they must be part of any candidate key. So, only option is D. If we see the FD's, adding A, B or D to EH do form candidate keys.
answered by Active (3.3k points)
selected by
+5 votes

Answer :  OPTION D
You can directly find the candidate key using two rules or you can say necessary attributes. 
An Attribute A is said to be a necessary attribute if 

(a)  A occurs only in L.H.S. (left hand side ) of the FD's(functional dependencies) in F  and/or
(b)  A is an Attribute in relation, But A doses not occur either in L.H.S. or R.H.S. of any FD in F. 

In other words, Necessary attributes never occur in the RHS of any FD in F. 

Here we can directly see, both attribute E and H not occur in RHS of any FDs. So, both of are necessary part of a candidate key. 

answered by Active (3.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

44,467 questions
49,922 answers
65,899 users