Why don't we decompose all relations into 2-attribute relations?

502 views Asked by At

Relations having only 2 attributes are in BCNF.

Why don't we decompose all relations into 2-attribute relations?

Because if we do so, we cannot achieve lossless join.

What is an example of decomposing a relation into 2-attribute relations where when we join them data is lost?

1

There are 1 answers

7
Mauricio Trajano On

Sometimes you can't decompose a table to 2 attributes based on the functional dependencies, a classical example my professor always uses is city, state, zipcode

FD{ city, state -> zip, zip->city}

Decomposing relationship R(city, state,zipcode) would not have dependency preservation.

Ex. You can't have the two tables R(city, state) and S(zip,city) because city,state is a super key but it doesn't determine zip in table R