PHPBuilder - Database Normalization and Design Techniques Page 3

RSS Twitter
Articles Databases

Database Normalization and Design Techniques - Page 3

by: Barry Wise
July 31, 2000

Second Normal Form

  1. Create separate tables for sets of values that apply to multiple records.
  2. Relate these tables with a foreign key.

We break the url values into a separate table so we can add more in the future without having to duplicate data. We'll also want to use our primary key value to relate these fields:
userId name company company_address
1 Joe ABC 1 Work Lane
2 Jill XYZ 1 Job Street

urlId relUserId url
1 1
2 1
3 2
4 2
Ok, we've created separate tables and the primary key in the users table, userId, is now related to the foreign key in the urls table, relUserId. We're in much better shape. But what happens when we want to add another employee of company ABC? Or 200 employees? Now we've got company names and addresses duplicating themselves all over the place, a situation just rife for introducing errors into our data. So we'll want to look at applying the Third Normal Form:

« Previous Page
Next Page »

Comment and Contribute

Your comment has been submitted and is pending approval.

Barry Wise



(Maximum characters: 1200). You have characters left.