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

DB HW3

Uploaded by

vortexmi6
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)
27 views2 pages

DB HW3

Uploaded by

vortexmi6
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

“I have done this assignment completely on my own.

I have not copied it, nor have I given my


solution to anyone else. I understand that if I am involved in plagiarism or cheating, I will have to
sign an official form that I have cheated and that this form will be stored in my official university
record. I also understand that I will receive a grade of 0 for the involved assignment and my
grade
will be reduced by one level for my first offense, and that I will receive a grade of “F” for the
course for any additional offense of any kind.”

Sign:

Name: Basil Eldho

Answers:

1. Faculty(fid, name, rank, office, email, deptname)


FDs: fid → name rank office email deptname, office → fid, email → fid

The schema R is in BCNF if for every non trivial FDs, the left side is a super key.
Here, the first FD, fid → name rank office email deptname have the fid in the left side
and it is super key. This FD satisfies BCNF.
For second and third FD, office → fid and email → fid: If office and email individually
determines fid and fid itself is a candidate key, then that
Means office and email are candidate keys/super keys as well. Hence the second and
third FDs contain super keys on the left side.
Therefore, the schema Faculty is in BCNF.

2. Registration(sid, classid, lgrade, ngrade)


FDs: sid classid → lgrade, sid classid → ngrade, ngrade → lgrade

a) To check if this is in 3NF:


For each FD X→A, one of the following must be true:
● (a) A∈X (trivial dependency),
● (b) X is a superkey, or
● (c) A is a prime attribute (part of a candidate key).

FD1: sid,classid→lgrade, sid

● Here, sid, classid is a superkey.


● This FD satisfies 3NF because X is a superkey.

FD2: sid,classid→ngrade
● sid, classid is a superkey.
● This FD also satisfies 3NF because X is a superkey.

FD3: ngrade→lgrade

a) Here, ngrade is not a superkey.


b) Neither lgrade nor ngrade are part of the candidate key {sid,classid}, so they are
non-prime attributes.
c) This FD violates the 3NF condition because lgrade is determined by ngrade.

Hence this table is not in 3NF due to FD3.

To convert it to 3NF using LLJD-DPD-3NF algorithm:

1. Candidate keys: sid, classid

2. Fmin : sid classid → lgrade, sid classid → ngrade, ngrade → lgrade

3. Decomposition: R1 = sid, classid ngrade

R2 = ngrade lgrade(ngrade is a foreign key referencing R1.ngrade).

4. No change because R1 already contains a candidate key sid, classid.

3.
a) {A → BC, BD → E} |= {AD → E}

Let BD→E be equation 1;

Applying IR-4 to A → BC, we get {A→B, A→C}.


Then we apply IR-2 to A→B, we get AD→BD be equation 2;

Applying IR-3 to equation 1 and 2: we get, AD→E. Hence proved!

b) {AB → AC, B → A} |= {B → C}

We apply IR-4 to AB →AC, we get AB →A, AB →C.


We apply IR-2 to B→A, we get B → AB.

Using the B →AB and AB →C, we apply IR-3 to get B →C. Hence proved!

You might also like