Class 14 Reading - Ginsusamurai/seattle-301d58 GitHub Wiki

Reasons to Normalize

  1. minimize duplicate data
  2. avoid/minimize data modification issues
  3. simplify queries

data duplication and modification anomalies

  1. increases storage and decreases performance
  2. more difficult to maintain data changes

consider an office moves cities, including all personnel:

  • if the employee info is all on 1 line, partial updates can cause incorrect info
  • requiring the same query on multiple columns, rather than just once customer1 = 'ford' or customer2='ford' etc

definition of database normalization

  • types are 1st,2nd and 3rd normal form or 1NF, 2NF, 3NF
  • the forms are progressive, so to be 3NF you need to meet requirements for 1NF and 2NF

1NF

  • informatino is stored in a relational table with each column containing atomic values. No Repeating Groups of columns

2NF

  • table is in first normal form and all the columns depend on the table's primary key

3NF

  • the table is in second normal forma nd all of its columns are not transitively dependent on the primary key.