The First Normal Form


Eliminate Repetition

Top of page  

We also get an efficiency benefit from the first normal form. When this database grows to a larger size we can easily query the database to determine which dogs know a particular trick. Not only will the queries be easier to write, the less complex queries also run faster! In an unnormalized database, we're basically running three queries! The queries below are written in SQL, which you aren't expected to know at this point, but they should be fairly easy to read.

Querying an
unnormalized Table
Querying a
1NF Table
      SELECT dog
      FROM dog
      WHERE trick1 = 'SIT'
      OR    trick2 = 'SIT'
      OR    trick3 = 'SIT';
      
      SELECT dog
      FROM skill
      WHERE trick = 'SIT';
      

Top of page  

Copyright © 1995 Craig Edward Given