Question

I'm currently studying normalization. I know how to normalize the data for given unnormalized list.

But this one is little bit confusing me

Q. Decompose R{a,b,c,d,e,f} into 2NF using following functional dependencies. 

a -> b,c,d,e,f 
b,c -> a,d,e,f 
b -> f 
d -> e 

For this my answer is:

R0 = a - > b,c
R1 = b,c - > a,d,e
R2 = b - > f

Can anyone help me with this?

Was it helpful?

Solution

There are two main issues:

  1. There is a lot of redundancy in your FDs set. You'll often save yourself some time if you compute the minimal cover first.

  2. The way you split the relation doesn't make sense, regardless of the normalization level. The candidate keys for this relation are A and BC; but in your answer you have all the keys together in R0 and nothing else, which is redundant (one key per table is enough) and useless (think about it, there is nothing you can query for in such a table!); and again you put all the keys together in R1, which is redundant as well.

A better way to decompose that relation would be

R1(B, F), R2(D, E), R3(A, B, C, D)

which satisfies both 2NF and 3NF.

BTW you should check out this Stanford course, it is really useful to understand normalization. Wikipedia pages are also well written.

EDIT to answer your question on the comments: a functional dependency means that the values on the RHS are determined by the values on the LHS. In this case we have

A -> BC
BC -> A

if you replace the letters with something more intuitive this is equivalent to:

post_id -> { post_title, post_date }
{ post_title, post_date } -> post_id

That is, if you know the post_id you can figure out both the post_title and the post_date; at the same time, if you know both the post_title and the post_date you can track back the post_id. This is the meaning of a circular dependency.

That said, in every relation all the FDs should be preserved so in R3 both BC -> D and A -> D hold, but you don't need ABC -> D which is not in your FDs set and it is clearly redundant. As a side, A -> D is redundant as well since you already have A -> BC, BC -> D. This is why I mentioned to compute the minimal cover first.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top