Professional Documents
Culture Documents
Solution
Solution
question is as follows:
"consider the following relation:
car sale(car#, date_sold, salesman#, commission%,
discount_amount)
Thus we have relation R as R(A,B,C,D,E) and functional dependencies that exist over R are
B--->E and C--->D primary key being AC.
Step-2: The only non trivial functional dependency that hold on R2 is B--->E (since B is subset of R2 and
E is subset of R2)
by computing attribute closure of B i.e. B+ we get
B+ = BE which contains all attributes of R2, hence B is a superkey of R2
The BCNF test says a relation R' is in BCNF if all the dependencies in F+ that holds on this relation
R' satisfies the condition........
Condition being: the attrbiute on the left side of arrow must be a superkey for schema R'
Sincel B is superkey for R2 hence R2 is in BCNF.
Step-3: The functional dependency c--->D holds on R1 but C is not a superkey of R1 ( Since C+={CD})
Thus we replace R2 by R3 nd R4
R3=(CD ) { R3=(C union D) and R4 = (R1-D)}
R4=(ABC)
Step-4: R3 is in BCNF as the only functional dependency that holds on R3 is C--->D and C forms a
superkey for the relation (by computing C+=(CD))
(sufficeint condition for R3 to be in BCNF)
Step-5: Since no dependency holds on R4 the test to check whether R4 is in BCNF is:
For every subset alpha (A,B,C,AB,BC,CA,ABC) of attributes of R4 check that attribute closure
over alpha either includes no attribute of R4-alpha or includes all
attributes of R4.
Let us compute attribute closure over subsets of R4:
Attribute Closure(alpha) Value R4-alpha
A+ A ABC-A= BC
B+ BE ABC-BE=AC
C+ CD ABC-CD=AB
AB+ ABE ABC-ABE=C
BC+ BCED ABC-BCED=A
CA+ ACD ABC-BE=B
ABC+ ABCDE ABC-ABCDE=phi
Note : The above test is conducted with functional dependencies in F and not in F+.
As the table shows for each subset the value of aplha+ includes no attribute of R4-alpha hence R4
is in BCNF.
Since R=R2 union R3 union R4 and R2, R3, R4 are in BCNF (as proven above), R is also in BCNF.
Notes:
Replace R by car_sale
Similarly replace ABCDE with corresponding attributes.
For alpha , beta, union, intersection use proper mathematical notations.
Imagine some proper names for R1,R2, R3,R4