in Databases retagged by
949 views
8 votes
8 votes

In a relational database relation, we say a non-empty set of attributes $\mathrm{X}$ is closed (with respect to a given set of functional dependencies FD) if $X^{+}=X$ (where $X^{+}$is the closure of $X).$ Consider a relation with schema $\mathrm{R}\{\mathrm{A}, \mathrm{B}, \mathrm{C}, \mathrm{D})$ and an unknown set of FD's.

If we are told which sets of attributes are closed, we can discover the FD's.

Assume that the only closed sets are $\{\mathrm{A}, \mathrm{B}\},\{\mathrm{A}, \mathrm{B}, \mathrm{C}, \mathrm{D}\}$.

Which of the following is/are true for $R?$

  1. The number of candidate keys is $2.$
  2. The number of non-prime attributes is $2.$
  3. $R$ is in $2 N F$.
  4. $R$ is in $3 N F$.
in Databases retagged by
949 views

1 comment

$ \large{\colorbox{yellow}{Detailed video solution of this question with direct time stamp}}$
All India Mock Test 2 - Solutions Part 3

1
1

4 Answers

13 votes
13 votes

First, notice that $\{A\}^{+}$is not $\{A\}$, and since $\{A, B\}^{+}=\{A, B\}$, it must be that $A \rightarrow B$ is an FD . With a similar argument, we have that $B \rightarrow A$ is another fd we must include.

The FDs will be:
$$
\{\mathrm{C} \rightarrow \mathrm{ABD}, \mathrm{D} \rightarrow \mathrm{ABC}, \mathrm{A} \rightarrow \mathrm{B}, \mathrm{B} \rightarrow \mathrm{A}\} \text {. }
$$
The candidate keys are $C, D$.

This is a beautiful question from the Ullman DBMS Book. Find Detailed Video Solution with Many more Variations: https://youtu.be/EU5O_8wH3Xw?t=1476  

edited by

2 Comments

@Deepak Poonia sir, why can't CD → AB be one of the FDS. Because if this is one of the FDs then it is not even 2NF

0
0

@amitarp818, Check the solution given above. $CD \rightarrow AB$ will be a FD for the given relation. And still the relation is in 2NF because candidate keys are $C, D.$ We do not have any composite candidate key here, So, relation will be in 2NF. 

2
2
5 votes
5 votes

Since only AB+ = AB, ABCD+ = ABCD
We can conclude following points-
1. A+ != A, so, A+  has something extra,
2. B+ != B , so B+ has something extra, 
now AB+ = AB so no new attributes can be added to A+ or B+, 
which implies –  A+ = AB, B+ = AB.
3. Now, ABC+ != ABC,
                 so ABC+ = ABCD, similarly ABD+ = ABCD
4. Now A brings B and B brings A =, so ACD+ = ABCD, BCD+ = ABCD
5. Now when X+ = R ( X is a set of attributes and R is the full relation), we know that X is superkey.
6. In this way, ABC, ADC, ABD, and BCD are superkeys.
7. From point 3 we also conclude that C brings D and D brings C.
8. From 4, 7 we can easily conclude the following – 
                    a. AB+ = AB
                    b. AC+ = ABCD
                    c. AD+ = ABCD
                    d. BC+ = ABCD 
                    e. BD+ = ABCD
                    f.  CD+ = ABCD

which implies AC, AD, BC, BD, CD ALL ARE SUPER KEYS.
9. From 7 and 8, C+ has to contain either A or B, but any of them brings the other,
             
so, C+ = ABCD,  similarly, D+ = ABCD.
Here, we find the Candidate keys to be C and D, which implies A and B are non-prime attributes.

10. Since the CKs are atomic hence the relation R is in 2NF,  
also, A+ = AB and B+ = AB  implies there are transitive dependencies of the type Non-prime implies Non-Prime.
Hence the relation R is not in 3NF. 


PS – There can be a more technical direct way to solve this question but it is one of a kind, new question, not seen yet, so this approach can be followed!

 

 

1 vote
1 vote

Hence,correct options are A,B,C.

Hope , this helps.

reshown by
Answer:

No related questions found