Showing posts with label Normalization. Show all posts
Showing posts with label Normalization. Show all posts

Sunday, May 8, 2016

Normalize the table, find keys, find minimal cover - Solved exercise

Normalization Quiz - Find the keys, candidate keys of a relational table, find the minimal cover of set of functional dependencies, check whether two sets of FDs are equivalent


Normalization – Find keys, find minimal cover, check for equivalent FDs

 

1. Let F = {A B, AB E, BG E, CD I, E C}. The closures, A+, (AE)+ and (ADE)+ will be ________.
(a) ABCE, ABDE, ABCDEI
(b) ABCE, ABCE, ABCDEI
(c) ABDE, ABCE, ABCDE
(d) ABCE, ABDE, ABCDI


2. Let F = {A B, A C, BC D}. Can A determine D uniquely?
(a) Yes
(b) No

3. Let F = {AB D, B C, BC D}. Can AC determine D uniquely?
(a) Yes
(b) No

4. Let F1 = {A C, AC D, E AD} and F2 = {A CD, E AH}. Are F1 and F2 are equivalent?
(a) Equivalent
(b) Not Equivalent

5. Find the minimal cover of the set of functional dependencies given; {A BC, B C, AB D}
(a) {A C, B C, AB D}
(b) {A C, B C, B D}
(c) {A B, B C, A D}
(d) {A BC, B C, A D}


6. Find the minimal cover of the set of functional dependencies given; {A C, AB C, C DI, CD I, EC AB, EI C}
(a) {A C, C DI, C I, E A, EI C}
(b) {A C, C D, C I, EC A, EC B}
(c) {B C, C DI, D I, E AB, EI C}
(d) {A C, C DI, CD I, I C}


7. Consider a relation R with set of functional dependencies F as follows; {A B, C D, AC E, D F}. How many keys does R have and what are they?
(a) 1, {(AC)}
(b) 2, {(AC), (AD)}
(c) 3, {(AC), (BC), (ABD)}
(d) 2, {(AC), (ABD)}


8. Consider a relation R(A, B, C, D, E) with FDs AB C, CD E, C A, C D, D B. What are the keys of R?
(a) AB, AC, D
(b) AC, BD
(c) AC, AD
(d) AB, AD, C
Solution: Visit for detailed answer here.


9. Consider a relation R(A, B, C, D, E) with FDs AB C, C A, C BD, D E. What are the keys of R? Decompose R into 3NF relations.
(a) {C}, R1(ABCD), R2(DE)
(b) {BD, AB}, R1(ABCD), R2(DE)
(c) {AB, C}, R1(ABCD), R2(DE)
(d) {BD}, R1(ABC), R2(CDE)
Solution: Visit for detailed answer here.


10. Consider a relation with schema R(A, B, C, D) with functional dependencies, BC A, AD B, CD B, AC D. Find all the candidate keys of R.
(a) AC, BC, CD
(b) AC, BC
(c) AC, AD
(d) BC, CD, A
Solution: Visit for detailed answer here.


********************




Find the closure of set of attributes

How to check whether an attribute determine the other uniquely from a set of functional dependencies?, Find the closure of set of attributes, Check whether the given attributes forms candidate keys, How to find closure of attributes? Find closure - solved exercise

Question:
3. Let F = {AB D, B C, BC D}. Can AC determine D uniquely?


Solution:
To find this, we need to find the closure of AC.
Closure:
In simple terms, if you know an attribute (or set of attributes) in a relation R, then what other attribute (or set of attributes) you would determine uniquely is called the closure. We normally find the closure of left hand side (LHS) attributes of the functional dependencies of relation R. Closure is used to find the candidate keys of the relation. Refer here to know more about attribute closure.

To find (AC)+:

result := AC

We cannot move further. That is, if you know A and C you cannot determine any other attribute in the relation as per the given set of FDs. No functional dependencies in the given F contains A alone, C alone or AC together in the left hand side.

Hence, the values of attributes AC cannot determine values of attribute D uniquely.

***************


Go back to Question/QUIZ page






How to find closure of set of attributes

Solved exercise in finding closure of attribute set

Easy way to find closure of attributes in DBMS

University exam questions on DBMS to find closure


Find the closure of set of attributes

Find the closure of set of attributes, Check whether the given attributes forms candidate keys, How to find closure of attributes? Find closure - solved exercise


Question:
1. Let F = {A B, AB E, BG E, CD I, E C}. The closures, A+, (AE)+ and (ADE)+ will be ________.

Solution:
Closure:
In simple terms, if you know an attribute (or set of attributes) in a relation R, then what other attribute (or set of attributes) you would determine uniquely is called the closure. We normally find the closure of left hand side (LHS) attributes of the functional dependencies of relation R. Closure is used to find the candidate keys of the relation. Refer here to know more about attribute closure.

To find A+:
result := A
If you know A, then you would know AB from the functional dependency (FD) A B.
result := AB
If you know AB, then you would know ABE from the FD AB E.
result := ABE
If you know ABE, then you would know ABEC from the FD E C.
result := ABCE
We have included all the LHS of given functional dependencies. No FDs of left hand that has ABCE in it. Hence, our algorithm stops at this point. And the closure is ABCE.

To find (AE)+:
result := AE
result := ABE from the FD A B
result := ABCE from the FD E C.
We cannot move further. Hence, the closure is ABCE.

To find (ADE)+:
result := ADE
result := ABDE from the FD A B
result := ABCDE from the FD E C
result := ABCDEI from the FD CD I
We cannot move further. Hence, the closure is ABCDEI.

The closures are;
A+ = ABCE
(AE)+ = ABCE
(ADE)+ = ABCEDI

****************


Go back to Question/QUIZ page






How to find closure of set of attributes

Quiz questions on closure

interview questions on database closures


Featured Content

Multiple choice questions in Natural Language Processing Home

MCQ in Natural Language Processing, Quiz questions with answers in NLP, Top interview questions in NLP with answers Multiple Choice Que...

All time most popular contents

data recovery