You are on page 1of 6

XIAMEN UNIVERSITY MALAYSIA

Mark:

Course Code : SOF202


Course Name : Database
Lecturer : Wang Hongji
Academic Session : 2018/04
Assessment Title : Assignment 9
Submission Due Date : 21st July 2018

Prepared by : Student ID Student Name


SWE1609486 AARON CHEN YIK HONG

Date Received :

Feedback from Lecturer:

1 10-28-2022 10:53:36 GMT -05:00


This study source was downloaded by 100000847106799 from CourseHero.com on

https://www.coursehero.com/file/32327750/assignment-9docx/
XIAMEN UNIVERSITY MALAYSIA

Own Work Declaration

I/We hereby understand my/our work would be checked for plagiarism or other
misconduct, and the softcopy would be saved for future comparison(s).

I/We hereby confirm that all the references or sources of citations have been correctly
listed or presented and I/we clearly understand the serious consequence caused by any
intentional or unintentional misconduct.

This work is not made on any work of other students (past or present), and it has not
been submitted to any other courses or institutions before.

Signature: AARON CHEN YIK HONG

Date: 21st July 2018

2 10-28-2022 10:53:36 GMT -05:00


This study source was downloaded by 100000847106799 from CourseHero.com on

https://www.coursehero.com/file/32327750/assignment-9docx/
XIAMEN UNIVERSITY MALAYSIA

Assignment 9

14.25. R = {A, B, C, D, E, F, G, H, I, J}. Repeat Exercise 14.24 for the following different
set of functional dependencies G = {{A, B}→{C}, {B, D}→{E, F}, {A, D}→{G, H},
{A}→{I}, {H}→{J}}.

{A, D} → {G, H} => {A, B, D} → {A, B, D, G, H}

Since {A} → {I} then {A, B, D} → {A, B, D, I}

{A, B} → {C} => {A, B, D} → {A, B, C, D}

{B, D} → {E, F} => {A, B, D} → {A, B, D, E, F}

{A, D} → {G, H} (given) => {A, D} → {H}.

Since {H} → {J} then {A, D} → {J}. Thus, {A, B, D} → {A, B, D, J}.

Finally, using the union rule {A, B, D} → {A, B, C, D, E, F, G, H, I, J}.

So {A, B, D} is a key.

2NF
R1 (A, B, C)
R2 (B, D, E, F)
R3 (A, D, G, H, J)
R4 (A, I)

3NF
R1 (A, B, C)
R2 (B,D, E, F)
R3.1 (A, D, G, H)
R4 (A, I) R3.2 (H, J)

3 10-28-2022 10:53:36 GMT -05:00


This study source was downloaded by 100000847106799 from CourseHero.com on

https://www.coursehero.com/file/32327750/assignment-9docx/
XIAMEN UNIVERSITY MALAYSIA

14.31. Consider the following relation for published books:


BOOK (Book_title, Author_name, Book_type, List_price, Author_affil,
Publisher)
Author_affil refers to the affiliation of author. Suppose the following
dependencies exist:

Book_title → Publisher, Book_type


Book_type → List_price
Author_name → Author_affil

a. What normal form is the relation in? Explain your answer.


The key for this relation is (Book_title, Author_name). This relation is in 1NF and not
in 2NF as no attributes are Full FD on the key. It is also not in 3NF.

b. Apply normalization until you cannot decompose the relations further. State
the reasons behind each decomposition.

2NF decomposition:
Book0(Book_title, Author_name)
Book1(Book_title, Publisher, Book_type, List_price)
Book2(Author_name, Author_affil)
This decomposition eliminates the partial dependencies.

3NF decomposition:
Book0(Book_title, Author_name)
Book1-1(Book_title, Publisher, Book_type)
Book1-2(Book_type, List_price)
Book2(Author_name, Author_affil)
This decomposition eliminates the transitive dependency of List_price.

14.35. Consider the relation:

4 10-28-2022 10:53:36 GMT -05:00


This study source was downloaded by 100000847106799 from CourseHero.com on

https://www.coursehero.com/file/32327750/assignment-9docx/
XIAMEN UNIVERSITY MALAYSIA

BOOK (Book_Name, Author, Edition, Year)


with the data:

Book_Name Author Edition Copyright_Year

DB_fundamental Navathe 4 2004


s

DB_fundamental Elmasri 4 2004


s

DB_fundamental Elmasri 5 2007


s

DB_fundamental Navathe 5 2007


s

a. Based on a common-sense understanding of the above data, what are the


possible candidate keys of this relation?

The candidate key is {Book_Name, Author, Edition}.


From the example, it would appear that {Book_Name, Author, Year} would also be a
candidate key but we should consider that sometimes Edition issues twice in a year.

b. Justify that this relation has the MVD {Book} →→ {Author} | {Edition,
Year}.

For attribute Book_Name all possible combinations of Author and {Edition,


Copyright_Year} are present in the BOOK relation and hence the given dependency is
valid.

c. What would be the decomposition of this relation based on the above


MVD? Evaluate each resulting relation for the highest normal form it
possesses.

BOOK (Book_Name, Edition)


BOOK_AUTHOR (Book_Name, Edition, Author)
BOOK_YEAR (Book_Name, Edition, Year)

5 10-28-2022 10:53:36 GMT -05:00


This study source was downloaded by 100000847106799 from CourseHero.com on

https://www.coursehero.com/file/32327750/assignment-9docx/
XIAMEN UNIVERSITY MALAYSIA

14.36. Consider the following relation:


TRIP (Trip_id, Start_date, Cities_visited, Cards_used)
This relation refers to business trips made by company salespeople. Suppose the
TRIP has a single Start_date but involves many Cities and salespeople may use
multiple credit cards on the trip. Make up a mock-up population of the table.

a. Discuss what FDs and/or MVDs exist in this relation.


FD1: (Trip_id → Start_date)

Cities_visited and Cards_used may repeat for particular Start_date or Trip_id. Cities_visited
and Cards_used are independent of each other and they also have multiple values. Also, both
Cities_visited and Cards_used are dependent on Trip_id and Start_date, so the MVDs present
in the relation are as follows:

MVD1: (Trip _ id → Cities _ visited | Cards _ used)

MVD2: (Start _ date → Cities _ visited | Cards _ used)

b. Show how you will go about normalizing the relation.

As there are no interdependencies, this relation can be trivially decomposed to


conform to 4NF:

TRIP_DATE (Trip_id, Start_date)

TRIP_CITIES (Trip_id, Cities_visited)

TRIP_CARDS (Trip_id, Cards_used)

6 10-28-2022 10:53:36 GMT -05:00


This study source was downloaded by 100000847106799 from CourseHero.com on

https://www.coursehero.com/file/32327750/assignment-9docx/
Powered by TCPDF (www.tcpdf.org)

You might also like