![]() |
The purpose of this document is to serve as a basic overview of database normalization. This example uses a hazarous waste disposal company as a client. The example company has customers, who have waste generator locations, who produce waste streams. Database Normalization:Normalization of a database is to separate redundant information into separate related tables. so instead of storing: Waste stream 1: John’s Exxon 123 Main, San Pedro, CA 99999, 310 555-1212, used oil Waste stream 2: John’s Exxon 123 Main, San Pedro, CA 99999, 310 555-1212, antifreeze Waste stream 3: John’s Exxon 123 Main, San Pedro, CA 99999, 310 555-1212, old tires We store it as: John’s Exxon 123 Main, San Pedro, 310 555-1212 Used oil Antifreeze Old tires That way, we eliminate the redundant storage of the generator address and reduce the possibility of bad data entry. We could further normalize this in many ways, but you get the idea. Customer Profiles: Standard admin contact information name address, phone Technical contact name address phone Waste Generators: Attached to customer by id number, so that customer #123 can have multiple locations. Technical contact for each location, but “same as” technical contact is accepted. Waste Streams: Attached to the waste generators by id number, so that customer #123’s locations can have x number of waste streams. Waste stream types could be held in a related table so that: Waste stream type: Attached to the waste streams by id so that for the billion or so gas stations, mechanics, auto parts stores etc., that recycle used oil, we don’t end up with data that looks like: OIL, Oil, Used Oil, Oil - Used, Oil-Dirty, Oil-dirty, etc. By controlling the data entry with unique lists, we assure valid and complete search results. Example of normalization with data: Customer table:
(Two gas stations)
Generator: table
(There are two locations for John’s Exxon and they have different technical contacts, one location for Mikes Mobil)
Waste stream type table:
By storing information this way, we can represent a lot of information in a small space. Example of two waste stream records:
What the above two lines really mean is:
Obviously this is wildly over-simplified, but the concept is there. |
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||