0% found this document useful (0 votes)
28 views

SQL Normalization

The document describes the process of normalizing a database from first normal form to third normal form. It shows an order table initially, then normalizes it into separate tables by removing partial and transitive dependencies in line with second and third normal form respectively. Each level of normalization results in data being split across multiple tables with fewer repeating groups and columns dependent only on the primary key.

Uploaded by

Sai
Copyright
© © All Rights Reserved
Available Formats
Download as XLSX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
28 views

SQL Normalization

The document describes the process of normalizing a database from first normal form to third normal form. It shows an order table initially, then normalizes it into separate tables by removing partial and transitive dependencies in line with second and third normal form respectively. Each level of normalization results in data being split across multiple tables with fewer repeating groups and columns dependent only on the primary key.

Uploaded by

Sai
Copyright
© © All Rights Reserved
Available Formats
Download as XLSX, PDF, TXT or read online on Scribd
You are on page 1/ 4

order

order id
product id
product name
customer id
order date
shipping address
billing address
mode of payment

customer
customer id
customer name
age
address
products
product id
product name
product price
Product Category
First Normal Fo Every cell in a column has to hold an atomic value

order id order status order price product name Product Categcustomer nam
1 Delivered 1700 Mouse,Keypad Electronics John Doe
2 Shipped 34000 Dining table Furniture Robert Luna
3 Packing 5000 Dancing doll Toys David Robinso
4 Delivered 2000 Rice Grocery John Reinhard
5 Shipped 7000 Monitor Electronics Betty Doe

order id product_id product name order status order status Product Categ
1 1 Mouse Delivered 1700 Electronics
1 2 Keypad Delivered 1700 Electronics
2 3 Dining table Shipped 34000 Furniture
3 4 Dancing doll Packing 5000 Toys
4 5 Rice Delivered 2000 Grocery
5 6 Monitor Shipped 7000 Electronics

80000

Second Normal First Normal Form + No partial dependency


Each non-primary key is fully dependent on the complete primary key
non-primary key

order id product_id order status order status customer namage


1 1 Delivered 1700 John Doe 32
1 2 Delivered 1700 John Doe 32
2 3 Shipped 34000 Robert Luna 23
3 4 Packing 5000 David Robinso 23
4 5 Delivered 2000 John Reinhard 26
5 6 Shipped 7000 Betty Doe 29

60000

Third Normal Fo Second Normal Form + No Transitive dependency


Transitive dependency is when a non-primary key is dependent on another non-key column which
age
32
23
23
26
29

customer namage composite key


John Doe 32
John Doe 32
Robert Luna 23
David Robinso 23
John Reinhard 26
Betty Doe 29

product_id product name Product Category


1 Mouse Electronics
2 Keypad Electronics
3 Dining table Furniture
4 Dancing doll Toys
5 Rice Grocery
6 Monitor Electronics

120

60120

nother non-key column which is dependent on the primary key

You might also like