0% found this document useful (0 votes)
15 views2 pages

Homework1 Sol

Uploaded by

jonathandikaspam
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
15 views2 pages

Homework1 Sol

Uploaded by

jonathandikaspam
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 2

Question A (50 marks)

1) The ER diagram [30 marks]

 Note: This is just a sample solution. The solution is not unique.

2) Map the ER diagram into relational model

BANK
Code Name Addr

BANK_BRANCH
Branch_no Branch_Addr Bcode

CAMPAIGN
Camp_no Scheme Branch_no

LOAN
Loan_no Date Type Amount Branch_no Cssn

CUSTOMER
Ssn CName CAddr Phone
PARTICIPATE
Cssn Camp_no

Question B. (50 marks)


(a) [10 marks]
∵A->{D,E} (Given)
∴ A->E and A->D (decomposition rule))
∵ D->{I,J} (Given)
∴ D->I, D->J (decomposition rule))
∵ A->D and D->I (proved)
∴ A->I(transitive rule )
∵A->E and A->I(proved)
∴ A->{E, I} (union rule)

(b) [10 marks]


{A,B,F} +={A,B,C,D,E,F,G,H,I,J} so it is a super key.
{AB}+={ A,B,C,D,E,F,G,H,I,J } so {A,B,F} is not a candidate key.
(c) [10 marks]
{A,D} +={A,D,E,I,J} so it is not a super key. It is not a candidate key.

(d) [10 marks]


This table only have one candidate key, that is AB, because only AB can determine C.
To normalize into 2NF, we remove the attributes that are functionally dependent on part of
the key (A or B) from R and place them in separate relations R1 and R2, along with the part
of the key they depend on (A or B), which are copied into each of these relations but also
remains in the original relation, which we call R3 below:
R1 = {A, D, E, I, J}, R2 = {B, F, G, H}, R3 = {A, B, C}
The new keys for R1, R2, R3 are underlined.

(e) [10 marks]


Next, we look for transitive dependencies in R1, R2, R3. The relation R1 has the transitive
dependency {A} -> {D} -> {I, J}, so we remove the transitively dependent attributes {I, J} from
R1 into a relation R11 and copy the attribute D they are dependent on into R11. The remaining
attributes are kept in a relation R12. Hence, R1 is decomposed into R11 and R12 as follows:
R11 = {D, I, J}, R12 = {A, D, E}
The relation R2 is similarly decomposed into R21 and R22 based on the transitive dependency
{B} -> {F} -> {G, H}:
R21 = {F, G, H}, R22 = {B, F}
The final set of relations in 3NF are {R11, R12, R21, R22, R3}

You might also like