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

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.

Related

functional dependencies , is this correct qusion

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)

Normalization Database finding keys, normal form, decomposition

Given a relation R(A,B,C,D,E) with functional dependencies: AB→C and C→D,
Find all key(s) of the relation R.
Which normal form is R in?
If R is not in BCNF, decompose R, as necessary, into a set of relations that are in BCNF.
Is your decomposition dependency-preserving? Briefly explain why or why not?
I am a little confused on finding the keys and normal form in R. Would anyone be able to explain it?
You should be able to get all your relation back with your keys.
So, in your example, if you start with the tuple (A, B, E), you can get C from AB, and then D from C; and that's it, you get your relation back, so you know that (A, B, E) is a key.
If you had, for example, started with the tuple (A, B), you wouldn't have been able to get E back, so you know that E must be part of your key tuple.

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.

Is this Lossy Join and Dependency Preserving

I am reading this topic Functional dependency and Normalization in Database Management Subject. I came across this example.
Relation R(A,B,C,D) Which one is Lossy join but Dependency Preserving BCNF Decomposition?
a. A ->B, B -> CD
b. A -> B, B -> C, C->D
c. AB -> C, C -> AD
d. A -> BCD
Now answer given is option C.
How can option C. be a lossy decomposition. if you do ABC union CAD = ABCD This satisfies first condition.
if we do ABC intersection CAD = AC which is perfectly fine, since in AC, C is key for (CAD) C -> AD decomposition. which also satisfies the second condition. Am i making any mistake in understanding this concept.
Usually for a Normalisation/decomposition exercise, you are given:
The full relation and its attributes. [yes: R(A, B, C, D)]
The Functional dependencies. [yes? it looks like a., b., c., d. are possible sets of Fun Deps.]
The proposed decomposition. [Often named R1, R2, etc. I don't see those. I can't interpret option d. to be proposing a decomposition.]
Perhaps your post has missed out part of the exercise? Perhaps the exercise wants you to decide which decomp preserves the dependencies in BCNF? (But results in a lossy join.)
[editted in response to Nikhil's comment] Note that the list of FD's alone doesn't amount to a decomposition: the FD C -> AD is short-hand for C -> A, C -> D. Does that mean two decomposing relations? No, because A and C are already in the FD AB -> C. So we have R1= (A, B, C), R2 = (C, D). But I don't know if that is what the exercise is asking. Think about it. What does option d. mean in terms of decompositions?
Perhaps the exercise is asking (for example): given a proposed decomposition into R1 = (A, B) and R2 = (B, C, D), which of the sets of FD's would give a lossy decomposition?
There's a worked example here: http://en.wikipedia.org/wiki/Lossless-Join_Decomposition.
It points to a previous q Lossless Join Property.
And there's further references.
By the way, options a., b., include the same Fun Deps as option d., by the transitivity of dependencies (Armstrong's Axioms http://en.wikipedia.org/wiki/Armstrong%27s_axioms see also http://en.wikipedia.org/wiki/Heath%27s_theorem). This is a clue.

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