Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

Databases: Candidate Keys Question Please Explain How To Find Parts A and B for

ID: 3698696 • Letter: D

Question

Databases: Candidate Keys Question

Please Explain How To Find Parts A and B for these questions?

NOTE: The answers have been provided... Just explain how to find parts A and B for each

Exercise 19.7 Suppose you are given a relation R with four attributes ABCD. For each of the following sets of FDs, assuming those are the only dependencies that hold for R, do the following: (a) Identify the candidate key(s) for R. (b) Identify the best normal form that R satisfies (1NF, 2NF, 3NF, or BCNF). (c) If R is not in BCNF, decompose it into a set of BCNF relations that preserve the dependencies. 2. B C, D A 3. ABC D, D- A 4, A ? B, BC ? D, A ? C 5, AB ? C, AB ? D, C ? A, D ? B

Explanation / Answer

First check RHS of the all functional dependency if any attribute not present than that attribute must be part of the candidate key.If closer of that attribute can derive all attributes than that attribute is candidate key(question 1).if not derive all attributes than add another attribute one by one and take closer if any derive all attributes than that is candidate key. candidate can be one or more.and this process continue until you find minimal set of attributes.

or

take closer one by one one attribute if you find all attributes than that is candidate key and if two or more element find all attributes than all of the candidate key.if not find all element in closer of one attribute than take two element by permutation one by one and if not find than take closer of three attributes and so on.

candidate key must be minimal i.e.

(A,B,C,D,E,F,G)

A+ = ABCDEFG (A,B)+ = ABCDEFG

Than candidate key is A

closer of any attribute is

--any attribute can determine itself

-- see functional dependency and check what an attribute determine

A?B,C?A,D?F,F?G,G?C,F?A,B?G

than closer of A+=A determine A,AdetermineB,B determine G,Gdetermine C

A+ = A,B,G,C

FOR SECOND PART

First check for highest NF, if any functional dependency voilate that NF than check for just lower NF and so on until find NF that is satisfied.

BCNF-- LHS must be super key

3NF-- LHS is super key or RHS is prime attributes

2NF- no any partial dependency(PD is, LHS is a proper subset of some candidate key and RHS is non prime attribute) .

1NF-- RHS must be atomic