RelationalDBDesign  Tweet
RedhatLinuxSysAdmin SeoMining

Basic SQL   «Prev  Next»
Lesson 6 An example of a customer table
Objective Understand what a table looks like if it is not normalized.
Let us take a look at an example table that contains customer data:

CustID Name City Item ID Description Qty Total
000001 Smith Tucson 100101 Green Widgets 1 $50.00
000001 Smith Tucson 100102 Blue Widgets 2 $100.00
000001 Smith Tucson 100103 Yellow Widgets 1 $50.00
000002 Jones L.A. 100101 Green Widgets 2 $100.00
000002 Jones L.A. 100106 Orange Widgets 1 $50.00

Because this is a basic order table, you can easily see that the table contains the customer ID, name, and city. It also includes the ordered item ID and description. For each item, the quantity and extended total are included.
You can quickly see that many elements are duplicated, making the table redundant to read through and requiring additional storage space. Using this approach, you would need to add two new columns to include the additional address information and the individual cost per item before this becomes a useful set of information.
Normalization, in simple terms, says that there will be one and only one reference to information in a given database, and that tables that use that information will use a pointer, for example, customer ID (CustID) and item ID above.
We will normalize this table in the next lesson.