DB_Normalization_Sample -...

Info iconThis preview shows pages 1–3. Sign up to view the full content.

View Full Document Right Arrow Icon
The Rules of Normalization are enforced by eliminating redundancy and inconsistent dependency  in your table designs.  This document explains what that means by examining the five progressive steps to  normalization you should be aware of in order to create a functional and efficient database. It also  details the types of relationships your data structure can utilize.  Let's say we want to create a table of user information, and we want to store each users' Name,  Company, Company Address, and some personal bookmarks etc.,. You might start by defining a  table structure like this:  Zero Form Users name company company_address url1 url2 Joe ABC 1 Work Lane abc.com xyz.com Jill XYZ 1 Job Street abc.com xyz.com We would say this table is in Zero Form because none of our rules of normalization have been  applied yet. Notice the url1 and url2 fields -- what do we do when our application needs to ask for  a third url? Do you want to keep adding columns to your table and hard-coding that form input  field into your code? Obviously not, you would want to create a functional system that could grow  with new development requirements. Let's look at the rules for the First Normal Form, and then  apply them to this table. 
Background image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Database Normalization and Design Techniques First Normal Form 1. Eliminate repeating groups in individual tables.  2. Create a separate table for each set of related data.  3. Identify each set of related data with a primary key.  Notice how we're breaking that first rule by repeating the url1 and url2 fields? And what about  Rule Three, primary keys? Rule Three basically means we want to put some form of unique,  auto-incrementing integer value into every one of our records. Otherwise, what would happen if  we had two users named Joe and we wanted to tell them apart? When we apply the rules of the  First Normal Form we come up with the following table:  users userId name company company_address url 1 Joe ABC 1 Work Lane abc.com 1 Joe ABC 1 Work Lane xyz.com 2 Jill XYZ 1 Job Street abc.com 2 Jill XYZ 1 Job Street xyz.com Now our table is said to be in the First Normal Form. We've solved the problem of url field  limitation, but look at the headache we've now caused ourselves. Every time we input a new 
Background image of page 2
Image of page 3
This is the end of the preview. Sign up to access the rest of the document.

This note was uploaded on 11/24/2011 for the course FINANCE 123 taught by Professor Hbr during the Spring '11 term at Lethbridge College.

Page1 / 8

DB_Normalization_Sample -...

This preview shows document pages 1 - 3. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online