The Gateway to Computer Science Excellence
+16 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$
in Databases by Veteran (52.2k points)
edited by | 2.1k views

2 Answers

+29 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.
by Active (3.4k points)
selected by
+7 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. 

by Active (4.1k 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
50,737 questions
57,388 answers
105,410 users