Given R(ABCD) ,and the given FD set
AB --> C , AB --> D , C --> A , D -->B
Hence the candidate key = AB as (AB)+ = (ABCD)
So C and D are not superkeys
Hence the given relation is not in BCNF as it requires every LHS side must be a superkey and C and D are not even candidate keys.
Hence we need BCNF decomposition preferably having lossless and dependency preserving property.First of all , we should know given a decomposition , how to map the functional dependencies from the original relation(table) into subrelations .They may be directly mapped or indirectly.
Let us consider a decomposition S(ABC) and T(ABD) .So let us consider the dependencies that will be mapped into S and to T from original relation R one by one.
a) For S(ABC) :
For ABC , the dependencies mapped will be :
AB --> C
C --> A
b) For T(ABD) :
For T(ABD) , the dependencies will be :
AB --> D
D --> B
So we can see that all of the functional dependencies from the original relation are satisfied and hence dependency preserving .But here also D is not a key for the subrelation T and C is not a key for S .
So this is not a BCNF decomposition.
So we have to construct separate subrelations(tables) for (CA) and (DB).Lets do that
Let W = (AC) having FD : C --> A
and X = (BD) having FD : D --> B
and Y = (ABC) having FD : AB --> C
and Z = (ABD) having FD : AB --> D
Now many of us can have doubt that we could have kept C --> A in Y(ABC) but it is not necessary.If a dependency is implied using any relation that is sufficient.Also with a given subrelation , we can define the FDs of subrelation according to our convenience but that should be in accordance with the original FD set .So for that reason only we are keeping AB --> C in Y(ABC) only not C -->A as it is mapped to W(AC) already and hence sufficient for dependency preservation.
Hence the above decomposition is BCNF decomposition and also having dependency preservation and lossless join property