You are on page 1of 5

Exercise 6

1. The dependency diagram in Figure below indicates that authors are paid royalties for each
book that they write for a publisher. The amount of the royalty can vary by author, by
book, and by edition of the book.

a. Based on the dependency diagram, create a database whose tables are at least in 2NF,
showing the dependency diagram for each table.
b. Create a database whose tables are at least in 3NF, showing the dependency diagram for
each table.
2. To keep track of office furniture, computers, printers, and so on, the
FOUNDIT company uses the table structure shown in the table below.

Sample ITEM Records


Attribute Name Sample Value Sample Value Sample Value
ITEM_ID 231134-678 342245-225 254668-449
ITEM_LABEL HP DeskJet 895Cse HP Toner DT Scanner
ROOM_NUMBER 325 325 123
BLDG_CODE NTC NTC CSF
BLDG_NAME Nottooclear Nottoclear Canseefar
BLDG_MANAGER I. B. Rightonit I. B. Rightonit May B. Next

a. Given that information, write the relational schema and draw the dependency diagram.
Make sure that you label the transitive and/or partial dependencies.
The answers to this problem are shown in figure above and the relational schema definition below
the figure..

The dotted transitive dependency lines indicate that these transitive dependencies are subject to
interpretation.

The relational schema may be written as follows:

ITEM(ITEM_ID, ITEM_DESCRIPTION, BLDG_ROOM, BLDG_CODE, BLDG_NAME,


BLDG_MANAGER)
b. Write the relational schemas and create a set of dependency diagrams that meet 3NF
requirements. Rename attributes to meet the naming conventions, and create new entities
and attributes as necessary.

FOUNDIT Co. Dependency Diagrams: all tables in 3NF

ITEM_ID ITEM_DESCRIPTION BLDG_ROOM BLDG_CODE

BLDG_CODE BLDG_NAME EMP_CODE

EMP_CODE EMP_LNAME EMP_FNAME EMP_INITIAL

FOUNDIT Co. Relational Diagram

EMPLOYEE BUILDING ITEM


EMP_CODE 1 BLDG_CODE 1 ITEM_ID
EMP_LNAME BLDG_NAME ITEM_DESCRIPTION
EMP_FNAME M EMP_CODE ITEM_ROOM
EMP_INITIAL M BLDG_CODE

The relational schemas are written as follows:

EMPLOYEE(EMP_CODE, EMP_LNAME, EMP_FNAME, EMP_INITIAL)

BUILDING(BLDG_CODE, BLDG_NAME, EMP_CODE)

ITEM(ITEM_ID, ITEM_DESCRIPTION, ITEM_ROOM, BLDG_CODE)

You might also like