Datasheet
To get around these problems we use a process called Normalization.
Normalization
Normalization is the process of separating repeated information into separate tables. There are whole
books dedicated to database design, but we only need to look at the simplest case.
A good beginner book on database design is Database Design for Mere Mortals: A Hands On Guide to
Relational Database Design, 2nd Edition (ISBN: 0-201-75284-0).
What we need to do is split the previous table into three tables, one for each unique piece of
information –
Customers, Orders, and OrderDetails. To link the three new tables together, we create
ID columns that uniquely identify each row. For example, we could create a column called
CustomerID
in the Customers table. To link the Customers table to the Orders table we also add this CustomerID
to the Orders table. Let's take a look at our tables now.
The
Customers table is as follows:
CustomerID Customer Address
1 John 15 High Street
BruminghamEngland
2 Chris 25 Easterly Way
Cradiff Wales
3 Dave 2 Middle Lane
OxboroughEngland
The Orders table is as follows:
OrderID CustomerID OrderDate
1 1 01/07/2003
2 1 01/08/2003
3 2 01/08/2003
4 3 01/09/2003
251
Reading From Databases
57076_Ch 8 SAN.qxd 01/12/2003 6:43 PM Page 251