-- Practice Midterm 2 Solutions
Names: Himanshu Mehta, Conover Wang, Ryan Moore, Sherwyn Sen, Andrew Yuan
1.
Perform 3NF Decomposition on
R(A, B, C, D, E)
AB->C
AC->B
AE->D
step 1. find minimal basis of FDs
delete AB->C?
(AB)+
AC->B -> no
AE->D -> no
can't delete
delete AC->B?
(AC)+
AB->C -> no
AE->D -> no
can't delete
delete AE->D?
(AE)+
AB->C -> no
AC->B -> no
can't delete
minimal basis
-
AB->C
AC->B
AE->D
step 2. make relations from minimal basis
AB->C R(A,B,C)
AC->B R(A,B,C) --> unnecessary
AE->D R(A,D,E)
step 3. if none of the relations are a superkey, find superkey and add a new relation from that
(ABC)+ -> no
(ADE)+ -> no
now find a superkey
del E? (ABCD)+ -> no
del D? (ABCE)+ -> (ABCDE) (from AE->D)
del C? (ABE)+ -> (ABCE) (from AB->C) -> (ABCDE) (from AE->D)
del B? (AE)+ -> (ADE) (from AE->D) -> no
del A? (BE)+ -> no
smallest superkey -> (ABE)
so make R(A,B,E)
answer: R(A,B,C,D,E) = R1(A,B,C) u R2(A,D,E) u R3(A,B,E)
(
Edited: 2018-11-14)
Names: Himanshu Mehta, Conover Wang, Ryan Moore, Sherwyn Sen, Andrew Yuan<br>
1.
Perform 3NF Decomposition on
R(A, B, C, D, E)
AB->C
AC->B
AE->D
step 1. find minimal basis of FDs
delete AB->C?
(AB)+
AC->B -> no
AE->D -> no
can't delete<br>
<br>
delete AC->B?<br>
(AC)+<br>
AB->C -> no<br>
AE->D -> no<br>
can't delete<br>
<br>
delete AE->D?<br>
(AE)+<br>
AB->C -> no<br>
AC->B -> no<br>
can't delete<br>
<br>
minimal basis<br>
-----<br>
AB->C<br>
AC->B<br>
AE->D<br>
<br>
step 2. make relations from minimal basis<br>
AB->C R(A,B,C)<br>
AC->B R(A,B,C) --> unnecessary<br>
AE->D R(A,D,E)<br>
<br>
step 3. if none of the relations are a superkey, find superkey and add a new relation from that<br>
(ABC)+ -> no<br>
(ADE)+ -> no<br>
<br>
now find a superkey<br>
del E? (ABCD)+ -> no<br>
del D? (ABCE)+ -> (ABCDE) (from AE->D) <br>
del C? (ABE)+ -> (ABCE) (from AB->C) -> (ABCDE) (from AE->D) <br>
del B? (AE)+ -> (ADE) (from AE->D) -> no<br>
del A? (BE)+ -> no<br>
<br>
smallest superkey -> (ABE)<br>
so make R(A,B,E)<br>
<br>
answer: R(A,B,C,D,E) = R1(A,B,C) u R2(A,D,E) u R3(A,B,E)