Activity 10.1 - DB Normalization

You might also like

Download as docx, pdf, or txt
Download as docx, pdf, or txt
You are on page 1of 12

Name: Mark Joseph Pijo Course/Section: BSIT – AI21

Activity 10.1

1. Add data on the tables (assume that this is not normalized yet)

2. Reflect on the table and follow the normalization steps base on the rules.

3. Normalize its table

4. Add all table in one document (lucid chart/google docs), should have relationships and
cardinality.

5. make sure that it is in highest normal form, highest will be BCNF (if needed).

Figure 10.1. Tables with its Attributes

Products Table

Not Normalized

Product Name Supplier Unit Price

Soap ABC, XYZ 10 20.5

Oil ABC 15 40

Sponge XYZ 40 80
1st Normal Form

Product Name Supplier Unit Price

Soap ABC 10 20.5

Soap XYZ 10 20.5

Oil ABC 15 40

Sponge XYZ 40 80

2nd Normal Form

Product_ID Product Name Unit Price Supllier

1 Soap 10 20.5 1

2 Soap 10 20.5 2

3 Oil 15 40 1

4 Sponge 40 80 2

S_ID Supplier

1 ABC

2 XYZ

3rd Normal Form

Product_ID Product Name Supplier Unit

1 Soap 1 10

2 Soap 2 10

3 Oil 1 15
4 Sponge 2 40

S_ID Supplier

1 ABC

2 XYZ

Unit Price

10 20.5

10 20.5

15 40

40 80

BCNF

Product_ID Product Name Supplier Unit_ID

1 Soap 1 00315

2 Soap 2 00412

3 Oil 1 00421

4 Sponge 2 00913

S_ID Supplier

1 ABC

2 XYZ

Unit_ID Unit Price

00315 10 20.5
00412 10 20.5

00421 15 40

00913 40 80

Vehicles Table

Not Normalized

Owner Plate_numb Type Registration Date Brand Model


er Registered

Sam 123423 Motorcycle 2344 10/25/21 Honda XRM

Sam 567832 Van 8765 10/01/21 Toyota Hi ace

Aden 167890 Van 4567 01/01/21 Kia Pregio

Vince 23456 Bus 2310 0/23/19 Daewoo BV115,


BF106

1st Normal Form

Owner Plate_numb Type Registration Date Brand Model


er Registered

Sam 123423 Motorcycle 2344 10/25/21 Honda XRM

Sam 567832 Van 8765 10/01/21 Toyota Hi ace

Aden 167890 Van 4567 01/01/21 Kia Pregio

Vince 23456 Bus 2310 0/23/19 Daewoo BV115

Vince 23456 Bus 2310 0/23/19 Daewoo BF106


2nd Normal Form

Owner Plate_number Type

Sam 123423 Motorcycle

Sam 567832 Van

Aden 167890 Van

Vince 23456 Bus

Vince 23456 Bus

Plate_number Registration Date Registered

123423 2344 10/25/21

567832 8765 10/01/21

167890 4567 01/01/21

23456 2310 0/23/19

23456 2310 0/23/19

Type Brand Model

Motorcycle Honda XRM

Van Toyota Hi ace

Van Kia Pregio

Bus Daewoo BV115

Bus Daewoo BF106


3rd Normal Form

Owner Plate_number Type_ID

Sam 123423 001

Sam 567832 002

Aden 167890 002

Vince 23456 003

Vince 23456 003

Plate_number Registration Date Registered

123423 2344 10/25/21

567832 8765 10/01/21

167890 4567 01/01/21

23456 2310 0/23/19

23456 2310 0/23/19

Type_ID Type Name Brand Model

001 Motorcycle Honda XRM

002 Van Toyota Hi ace

002 Van Kia Pregio

003 Bus Daewoo BV115

003 Bus Daewoo BF106


BCNF

ID Owner Plate_number Type_ID

1 Sam 123423 001

2 Sam 567832 002

3 Aden 167890 002

4 Vince 23456 003

5 Vince 23456 003

Plate_number Registration Date Registered

123423 2344 10/25/21

567832 8765 10/01/21

167890 4567 01/01/21

23456 2310 0/23/19

23456 2310 0/23/19

Type_ID Type Name Brand Model

001 Motorcycle Honda XRM

002 Van Toyota Hi ace

002 Van Kia Pregio


003 Bus Daewoo BV115

003 Bus Daewoo BF106

Personnel Table

Not Normalized

Name Role Branch Location Salary/per month

Mark Cashier Palo 22000

Jam Car Washer Palo 25000

Kevin Auto Mechanic, Tacloban 30000


Automotive Technician

1st Normal Form

Name Role Branch Location Salary/per month

Mark Cashier Tanauan 22000

Jam Car Washer Palo 25000

Kevin Auto Mechanic Samar 30000

Kevin Automotive Technician Samar 30000

2nd Normal Form

Personnel_ID Name Role Branch Location Salary/per month

1 Mark Cashier Tanauan 22000

2 Jam Car Washer Palo 25000

3 Kevin Auto Mechanic Tacloban 30000

4 Kevin Automotive Tacloban 30000


Technician

3rd Normal Form

Personnel_ID Name Branch Location Role

1 Mark Tanauan Cashier

2 Jam Palo Car Washer

3 Kevin Tacloban Auto Mechanic

4 Kevin Tacloban Automotive Technician

Role Salary/per month

Cashier 22000

Car Washer 25000

Auto Mechanic 30000

Automotive Technician 30000

BCNF

Personnel_ID Name Branch Location Role_ID

1 Mark Tanauan 1352

2 Jam Palo 4685

3 Kevin Tacloban 7598

4 Kevin Tacloban 4265


Role_ID Role Salary/per month

1352 Cashier 22000

4685 Car Washer 25000

7598 Auto Mechanic 30000

4265 Automotive Technician 30000

Sales Table

(Note: Since this Sales Table is the Table that has relationship to the 3 tables: Personnel,
Vehicles, and Products,and the attributes that were written in Figure 10.1 for the Sales Table
were not the primary keys from the other tables, I decided to change and use the normalized
primary keys in Personnel, Vehicles, and Products.

PS: The attribute date is what I am not sure what it is supposed to be but I assume that it will be
the Month date and Year date.)

Not Normalized

Personnel_ID Vehicle_ID Product_ID Date

1 2, 3 4 November 2021

2, 4 1 2 November 2021

3 2 3, 1 October 2021

1st Normal Form

Personnel_ID Vehicle_ID Product_ID Date


1 2 4 November 2021

1 3 4 November 2021

2, 1 2 November 2021

4 1 2 November 2021

3 2 3 October 2021

3 2 1 October 2021

2nd Normal Form

Sales_ID Personnel_ID Vehicle_ID Product_ID Date

1 1 2 4 November 2021

2 1 3 4 November 2021

3 2, 1 2 November 2021

4 4 1 2 November 2021

5 3 2 3 October 2021

6 3 2 1 October 2021

(Note: So far, I don’t see anything that violates the normalization at this point, therefore I conclude that
this will be the highest normal form for Sales Table.)

Relationships and Cardinality:

You might also like