Professional Documents
Culture Documents
NORMALIZATION
NORMALIZATION
ORDERS
1. All the tables must contain a single value at the intersection of row and column
2. The table must not contain repeated groups of data
Example:
In the above orders table the customer information is repeating so we
have to separate tat information into another table. Also the Items column
contains a set of vales not a single value. We have to provide different columns
for each value of the group. To achieve the rules of 1NF, the orders table will be
divided into two tables
1. CUSTOMERS (CNO*,CNAME,CADD)
2. ORDERS(SNO,ORDNO,ORDDATE,CNO,INO,IDESC,QTY,PRICE)
(*SNO,ORDNO)
Customers:
ORDERS:
Example: In the above example, the ORDDATE and CNO columns depends only
on ORDNO, which alone is not a primary key. So, we have to remove this
information into another table as follows:
1. CUSTOMERS (CNO*, CNAME, CADD)
2. ORDERS (SNO, ORDNO, INO, IDESC, QTY, PRICE) (*SNO,ORDNO)
3. ORDER DETAILS(ORDNO*,ORDATE,CNO)
Customers:
CNO CNAME CADD
10 ANIL Hyderabad
11 JAGAN Secunderabad
Orders:
SNO ORDNO INO IDESC QUNATITY PRICE
Order Details:
ORDNO ORDDATE CNO
100 1/1/99 10
101 1/2/99 20
102 1/2/99 10
Example:
In the above orders table Idesc column depends on primary key as well as
INO column which is not a primary key. To satisfy 3NF, this information can be
separated into another table.
1. CUSTOMERS (CNO*, CNAME, CADD)
2. ORDERS (SNO, ORDNO, INO, QTY, PRICE) (*SNO,ORDNO)
3. ORDER DETAILS(ORDNO*,ORDATE,CNO)
4. ITEMS (INO*,IDESC)
Customers:
CNO CNAME CADD
10 ANIL Hyderabad
11 JAGAN Secunderabad
Orders:
SNO ORDNO INO QUNATITY PRICE
1 100 I1 25 100
2 100 I2 20 120
1 101 I3 20 80
2 101 I2 10 60
1 102 I3 25 100
Order Details:
ORDNO ORDDATE CNO
100 1/1/99 10
101 1/2/99 20
102 1/2/99 10
Items:
INO IDESC
I1 Item1
I2 Item2
I3 Item3
Lossless-join dependency
A property of decomposition, which ensures that no spurious tuples are generated
when relations are reunited through a natural join operation.
Join dependency Describes a type of dependency. For example, for a relation R
with subsets of the attributes of R denoted as A, B, …, Z, a relation R satisfies a
join dependency if, and only if, every legal value of R is equal to the join of its
projections on A, B, …, Z.