Wednesday, February 23, 2011

Normalising Databases

Normalising: getting rid of redundant data
if there is redundant data:
  • takes up too much space
  • if one needs to be edited than all will required to be edited
  • creates maintainence problems
Normalisation process is theorectically by progressional decomposing design into a sequence of normal forms - first, second and third.

First Normal Form (1NF):
  • deals with the removal of repeating attributes across horizontal rows abnd ensures each field holds single data items.
  • each field stores single data
  • no multiple data items within individual fields and no fields are repeated
Second Normal Form (2NF)
  • removes redundant data within verticle columns ro fields
  • all tables must be in first normal form
  • every non-key attribute is funtionally dependant on the table's primary key - but not unique (primary key defines the attribute + identifies the non key attribute - functionallt dependant) 
  • e.g date of birth, address and phone number are functionaly dependant on student ID
Third Normal Form (3NF)
  • removes furyher redundant data within vertical columns or fields
  • all tables must be in second normal form
  • every non-key attribute is functionally dependant only on teh table's primary key and not on any other attributes of the table.
  • e.g. Kmart Layby! -> Layby no. -> phone number, suburb, surname -> functionally dependant on customer details

No comments:

Post a Comment