You are on page 1of 16

WEEK 5:

NORMALIZATION
DATABASE DESIGN USING BOTTOM-UP APPROACH
(NORMALIZATION TECHNIQUE)
Prepared By: Nor Mas Aina Md Bohari @ Oct 2017

1
Exercise 1

2
Exercise 1 Full Dependencies / Full Functional Dependencies

INF ProjNo ProjName EmpNo EmpName JobClass ChgPerHour Hours TotalChg

Partial Dependency Partial Dependencies

Transitive Dependency ERD

2NF ProjNo ProjName PROJECT PROJECT JOB_CLASS


EmpNo EmpName JobClass ChgPerHour EMPLOYEE PK ProjNo PK JobClass
ProjName ChgPerHour
Transitive Dependency
has
ProjNo EmpNo Hours TotalChg ASSIGNMENT has
EMPLOYEE
3NF ProjNo ProjName PROJECT PK EmpNo
ASSIGNMENT EmpName
JobClass ChgPerHour JOB_CLASS PK,FK ProjNo FK JobClass
PK,FK EmpNo
EmpNo EmpName JobClass EMPLOYEE Hours
TotalChg involved in
ProjNo EmpNo Hours TotalChg ASSIGNMENT 3
Exercise 1 (Improving Design – Optional)
3NF ProjNo ProjName ProjTotalChg PROJECT
JobCode JobClass JobChgPerHour JOB_CLASS

EmpNo EmpName JobClass EMPLOYEE


ERD
ProjNo EmpNo AssignHours AssignTotalChg ASSIGNMENT
PROJECT JOB_CLASS
PK ProjNo PK JobCode
ProjName JobClass
ProjTotalChg ChgPerHour

has
has EMPLOYEE
PK EmpNo
ASSIGNMENT EmpName
PK,FK ProjNo FK JobCode
PK,FK EmpNo
AssignHours
AssignTotalChg involved in
4
Exercise 2
A book is identified by its ISBN number, and it has a title, a price, and a date
of publication. It is published by a publisher, which has its own ID number
and a name. Each book has exactly one publisher, but one publisher
typically publishes multiple books over time.

A book is written by one or multiple authors. Each author is identified by an


author number and has a name and date of birth. Each author has either
one or multiple books; in addition, occasionally data are needed regarding
prospective authors who have not yet published any books.

5
Exercise 2
INF ISBN Title Price DatePub PubID PubName AutID AutName AutDOB

Partial Dependencies Partial Dependencies

Transitive Dependency
ERD

2NF ISBN Title Price DatePub PubID PubName BOOK AUTHOR PUBLISHER
PK AutID PK PubID
Transitive Dependency AutName PubName
AutDOB
AutID AutName AutDOB AUTHOR has
/published by
ISBN AutID BOOK_AUTHOR write
BOOK
PK ISBN
3NF PubID PubName PUBLISHER BOOK_AUTHOR Title
ISBN Title Price DatePub PubID PK,FK ISBN Price
BOOK DatePub
PK,FK AutID
AutID AutName AutDOB FK PubID
AUTHOR
ISBN AutID BOOK_AUTHOR written by 6
Exercise 2 (Improving Design – Optional)
3NF PubID PubName PUBLISHER
ISBN BookTitle BookPrice BookPublishDate PubID BOOK
AutID AutName AutDOB AUTHOR
ISBN AutID BOOK_AUTHOR ERD

AUTHOR PUBLISHER
PK AutID PK PubID
AutName PubName
AutDOB
has
/published by
write
BOOK
PK ISBN
BOOK_AUTHOR BookTitle
PK,FK ISBN BookPrice
PK,FK AutID BookPublishDate
FK PubID

written by 7
Exercise 3
Room Utilization Report (Year 2015)

Room Number Type of Room Customer Customer Usage Dates


Name Identification Start Date End Date
Number
R01 Meeting Room 1 Yahaya 881213-01-4878 15-Jan-2015 15-Jan-2015
R01 Meeting Room 1 Amir 800917-04-9872 30-May-2015 31-May-2015

R02 Meeting Room 2 Syahida 900619-03-1234 15-Jan-2015 15-Jan-2015


R03 Seminar Hall Mohd Fadzil 781231-05-4774 01-Jan-2015 04-Jan-2015
R04 Conference Hall Syahida 900619-03-1234 01-Jan-2015 04-Jan-2015
R04 Conference Hall Safiza 850202-04-3256 26-Feb-2015 26-Feb-2015
R05 Discussion Room 1 Razak 910808-07-6336 30-May-2015 31-May-2015

R06 Discussion Room 2


R07 Discussion Room 3 Nor Mas Aina 920909-05-2562 30-May-2015 31-May-2015

8
Exercise 3 Full Dependencies

INF RoomNo RoomType CustName CusICNo StartDate EndDate

Partial Dependency Partial Dependency

ERD

2NF RoomNo RoomType ROOM ROOM


CusICNo CustName CUSTOMER PK RoomNo
RoomType
RoomNo CusICNo StartDate EndDate BOOKING

booked by
CUSTOMER
3NF RoomNo RoomType ROOM PK CusICNo
BOOKING CusName
CusICNo CustName CUSTOMER
PK,FK RoomNo
RoomNo CusICNo StartDate EndDate PK,FK CusICNo
BOOKING StartDate book
EndDate
9
Exercise 4
Attribute Name Sample Value Sample Value Sample Value Sample Value Sample Value

INV_NUM 211347 211347 211347 211348 211349

PROD_NUM AA-E3422QW QD-300932X RU-995748G AA-E3422QW GH-778345P

SALE_DATE 15-Jan-2016 15-Jan-2016 15-Jan-2016 15-Jan-2016 16-Jan-2016

PROD_LABEL Rotary sander 0.25-in. drill bit Band saw Rotary sander Power drill

VEND_CODE 211 211 309 211 157

VEND_NAME NeverFail, Inc. NeverFail, Inc. BeGood, Inc. NeverFail, Inc. ToughGo, lnc

QUANT_SOLD 1 8 1 2 1

PROD_PRICE $49.95 $3.45 $39.99 $49.95 $87.75


Notes:
 Invoice number references more than one product.
10
 Any given product is supplied by a single vendor, but a vendor can supply many products.
Exercise 4 Full Dependency

INF INV_NUM PROD_NUM SALE_DATE PROD_LABEL VEND_CODE VEND_NAME QUANT_SOLD PROD_PRICE

Partial Dependency

Partial Dependencies
Transitive Dependency
2NF INV_NUM SALE_DATE INVOICE ERD
PRODUCT VENDOR
PROD_NUM PROD_LABEL VEND_CODE VEND_NAME PROD_PRICE INVOICE PK VEND_CODE
VEND_NAME
PK INV_NUM
Transitive Dependency SALE_DATE
supply
INV_NUM PROD_NUM QUANT_SOLD INVOICE_LIST /supplied by

contain PRODUCT
3NF INV_NUM SALE_DATE INVOICE PK PROD_NUM
PROD_LABEL
VEND_CODE VEND_NAME VENDOR PROD_PRICE
INVOICE_LIST FK VEND_CODE
PROD_NUM PROD_LABEL PROD_PRICE VEND_CODE VENDOR PK,FK INV_NUM
PK,FK PROD_NUM
INV_NUM PROD_NUM QUANT_SOLD QUANT_SOLD
INVOICE_LIST listed in 11
Exercise 5

12
Exercise 5
INF ProdID ProdCat SalesPersID SalesPersName JobPosition Salary SupplierID SupplierName

Partial Dependency Partial Dependencies Partial Dependency

Transitive Dependency

2NF ProdID ProdCat PRODUCT

SalesPersID SalesPersName JobPosition Salary SALESPERSON

Transitive Dependency

SupplierID SupplierName SUPPLIER

ProdID SalesPersID SupplierID TASK


13
Exercise 5
3NF ProdID ProdCat PRODUCT
JobPosition Salary JOBPOSITION
SalesPersID SalesPersName JobPosition SALESPERSON

SupplierID SupplierName SUPPLIER


ProdID SalesPersID SupplierID TASK ERD PRODUCT JOBPOSITION
PK ProdID PK JobPosition
ProdCat Salary

has
has
SALESPERSON
PK SalesPersID
SUPPLIER TASK SalesPersName
PK SupplierID supply
PK,FK ProdID FK JobPosition
SupplierName PK,FK SalesPersID
PK,FK SupplierID
involved in
14
Exercise 6

15
Exercise 6 Full Dependencies

INF CustNo CustName DateOut DateReturn BookNo BookTitle

Partial Dependency Partial Dependency

ERD

2NF CustNo CustName CUSTOMER CUSTOMER


BookNo BookTitle BOOK PK CustNo
CustName
CustNo CusICNo DateOut DateReturn RENTAL

booked by
BOOK
3NF CustNo CustName CUSTOMER PK BookNo
RENTAL BookTitle
BookNo BookTitle BOOK
PK,FK CustNo
CustNo CusICNo DateOut DateReturn RENTAL PK,FK BookNo
DateOut book
DateReturn
16

You might also like