functional dependencies , is this correct qusion - database

Consider relation R(A,B,C,D,E). The following functional dependencies are assumed to hold over R:
A -> B, C
B -> D
What is a key of R? If there are multiple candidate keys list all.
I think there is missing FD, but not sure can any one help and also decompose to 3NF.

I am assuming that the two dependencies are a cover of the dependencies of R. In this case, the only candidate key is {A, E}.
A decomposition in 3NF arising from the classical synthesis algorithm is the following:
R1 (A, B, C)
R2 (B, D)
R3 (A, E)

Related

Normalizing a table with 5 attributes A, B, C, D, and E

This is a pretty basic question from early on in the semester, which I got wrong. I am asking this for a better and more accurate answer from others in preparation for the final exam.
Normalizing a table with 5 attributes A, B, C, D, and E. Where A and B is a composite key. With no other prime attributes.
a. If you have a partial dependency B to C, what would you do to normalize the relation?
b. If you have a dependency D to E, what would you do to normalize the relation?
Normalization is something that can be done only trough Functional Dependencies. So let's reformulate you question using them.
Normalizing a table with 5 attributes A, B, C, D, and E. Where A and B is a composite key. With no other prime attributes.
This means that we have a relation schema
R(A, B, C, D, E)
with the only non-trivial functional dependency:
A B → C D E
This relation is in Boyce-Codd Normal Form (BCNF) as well as in Third Normal Form (3NF).
If you have a partial dependency B to C, what would you do to normalize the relation?
Now we add the dependency B → C, which violates both the BCNF (that require that each determinant be a superkey) and the 3NF (that tolerates non-superkyes determinant if the determinate is a prime attribute, that is an attribute which belongs to any key, and C is not a prime attribute since the only key is A B).
In this case the normalization is simple, we decompose the original relation R in two relations, the first, R1(B, C), that represent the information that ties B and C, so that we can know for each value of B which is the only corresponding value of C, the second R2(A, B, D, E) that represents the fact the the values of D and E are uniquely determined by a couple of values A and B. The two relations R1 and R2 are both in BCNF and in 3NF, since the key of R1 is B, while the key or R2 is A B.
It is worth mentioning the fact that this decomposition is loss-less and dependency preserving.
If you have a dependency D to E, what would you do to normalize the relation?
Also in this case the strategy is to decompose R in two relations, this time in R1(A, B, C, D) and R2(D, E). Again, we can note that both relations are in BCNF and in 3NF, and that data and dependencies are preserved.

Can someone tell me if this relation is in 3NF?

Consider a relation R(A, B, C, D, E) with the following function dependencies: A->BC, D->CE, C->E
AD+ = ABCDE
Prime Attributes: AD
Non-Prime Attributes: BCE
Decomposed into 3NF but not BCNF
R1(A, B, C, D) R2(C,E)
It's been a long time for me since I've done this. But if I remember right in 3NF it is not allowed for a column to be in a table if it is transitively dependent on another column.
In this case, the only transitive dependency is A -> C -> E, which means E needs to be extracted from R.
This you have done to my understanding.
Something tells me you might need to extract C from R1, but that is probably only nessecary in BCNF.
The third normal form in your case is the following:
R1 (A B C)
R2 (C E)
R3 (C D)
R4 (A D)
Note that this is the only way of decomposing your relations in third normal form preserving the dependencies, and that all the resulting dependencies are such that all the decomposed schemas are also in BCNF.
Finally, one can note that the same relation can be decomposed in BCNF in different ways by losing some functional dependency.

Consider the universal relation R = {A, B, C, D, E, F, G, H, I, J}. What is the key for R? Decompose R into 2NF and then 3NF relations

Consider the universal relation R = {A, B, C, D, E, F, G, H, I, J} and the set of
functional dependencies F = { {A, B}→{C}, {A}→{D, E}, {B}→{F}, {F}→{G,
H}, {D}→{I, J} }. What is the key for R? Decompose R into 2NF and then
3NF relations.
I tried every solution given on internet but still not able to understand the answer even my instructor is not answering me satisfactorily. Can someone please explain me this?
Yes this was asked in homework but it has already been marked wrong and i just want to learn this concept. Thank you.
There is a 6 step process that will lead you to the answer but in many cases the key is to figure out which attribute or set of attributes have only out going relations and no incoming. Here except for A,B all other attributes have dependencies on A,B directly or indirectly. Hence A,B is the key for this relation. This is not the perfect answer but will lead you to the goal in most of the cases.
Once you arrive at the key, use that key and check if you can reach all the attributes directly or transitively. If yes then bingo, you have your key. In your case with A,B we can get to all the attributes.
Attribute set closures
AB+=CDEFGHIJ
AF+=CDEGHIJ
A+=CDEIJ
A+=CDEIJ
B+=CFGH
Candidate keys {AB,AF}
Prime attributes {A,B,F}
Non-prime attributes {C,D,E,F,G,H,I,J}

What normal form are the this relation in? Am I right?

-
R(a, b, c, d)
Functional dependencies: None
I think it is 0NF, because there are no functional dependencies.
R(a, b, c, d)
Functional dependencies: b->d AND a,b->c
This should be 3NF, i think.
I am stuck at this one
R(a, b, c, d, e)
Functional dependencies: a->d,e AND a,d->b,c,e
There is always the trivial dependency,
a,b,c,d -> a,b,c,d
The key is the entire relation. Not often useful, but not 0NF.
R(a, b, c, d)
Functional dependencies: b->d AND a,b->c
This should be 3NF, i think.
No, it's 1NF. The only candidate key is ab. That means b->d represents a partial key dependency, so R's normal form must be lower than 2NF.

Convert To BCNF

I'm given the following relation:
R(A,B,C,D,E)
and the following Functional Dependencies:
F1 - AC -> D
F2 - D -> E
F3 - E -> A
I am attempting to convert this to BCNF form.
The first step I took was to figure out the possible keys for the relation.
Keys: ABC, BCD, BCE
Then I checked to see if the functional dependencies fit BCNF form, they do not.
So I attempted to decompose and got the following:
R1(A,C,D) AC->D Keys: AC
R2(D, E) D->E Keys: D
I believe at this point that the relations are in BCNF form and are lossless, but are not dependency preserving.
Does this seem like the right technique for this sort of thing? Is there a step or two I might have missed?
I believe there is an error in your BCNF. Between R1 and R2, you've lost B.
Keys, ABC, BCD and BCE are correct. (You require B, C and one of either A, D or E).
R1 (A, B, C, D), key ABC and R2 (D, E) with key D is a valid normalization.

Resources