Normalization
Normalization
TEACHER TABLE
TeacherID Name SubjectID Subject Hours
T- 001 Claire S-01 Chemistry 2
T- 001 Claire S-01 Physics 3
T-002 George S-02 Biology 1
T-002 George S-02 Science 5
T-003 Marissa S-03 Mathematic 4
T-004 Chester S-04 English 2
T-004 Chester S-04 Filipino 2
2NF
STUDENT TABLE
3NF
JOBCODE JOB
CITYCODE CITY
J-01 Clerk
C-001 Quezon
J-02 Manager
C-002 Pasig
J-03 Cashier
C-003 Makati
J-04 Utility
C-004 Taguig
EMPLOYEE TABLE
EmployeeID Name JOBCODE CITYCODE
E-001 Claire J-01 C-001
E-002 George J-02 C-002
E-003 Marissa J-03 C-003
E-004 Chester J-04 C-004
Denormalization trades some write performance for faster reads by strategically adding
duplicate data to an already well-organized database.
Orders table: order_id (primary key) customer_id (foreign key) date_placed total_price
Frequent query: Display order details including product names and prices.
Normalized execution: Join Orders and Products tables on order_id and product_id. Retrieve
required data from both tables. This join operation can be slow, especially for large datasets.
When placing an order, copy the corresponding product's name from the Products table into the
product_name column of the Order entry.
This table is denormalized because it adds the "product_name" information to the "Orders"
table, duplicating data already present in the "Products" table. This redundancy sacrifices write
performance for significantly faster reads of frequent queries that need both order and product
information.