FOR FREE MATERIALS

Question: GATE and UGC NET

 

Before seeing the question please follow chapters: Find Super and Candidate Key from Attribute Closure, Find Prime and Non-Prime Attribute

 

Q: UGC NET 2015-II, Q.20

A relation R = {A, B, C, D, E, F, G} is given with following set of functional dependencies: F = {AD → E, BE → F, B → C, AF → G}. Which of the following is a candidate key?

A. A

B. AB

C. ABC

D. ABD

 

Solution:

R = {A, B, C, D, E, F, G}

FDs = {AD → E, BE → F, B → C, AF → G}

 

 

So, Candidate Key = {ABD

Prime Attribute = {A, B, D

 

There are no such FDs, whose R.H.S contains any one of the prime attributes so that we can replace it with its LHS.

Candidate Key = {A B D}

So, option (D) is correct.

 

Q: GATE CS 2013. Q.54

Relation R has eight attributes ABCDEFGH. Fields of R contain only atomic values. F = {CH → G, A → BC, B → CFH, E → A, F → EG} is a set of functional dependencies (FDs) so that F+ is exactly the set of FDs that hold for R.

How many candidate keys does the relation R have?

(A) 3
(B) 4
(C) 5
(D) 6

 

Solution:

 

To get whole relation or tables we have to add attributeD’ to all then we can get the super key as well as candidate key.

 

So, there is  a total 4 candidate keys AD, BD, ED, and FD.