Upgrade to Pro — share decks privately, control downloads, hide ads and more …

Data Normalization

Data Normalization

Lightning Talk - Code Fellows

Presentation: http://www.youtube.com/watch?v=tEruPKjWDic

Avatar for Diana Pham

Diana Pham

July 15, 2013

More Decks by Diana Pham

Other Decks in Technology

Transcript

  1. rails and databases? title author year shelf “How to Cure

    Headaches” Yee, Corn 2010 Apple “Healthy Sleeping” Boo, Honey 2012 aple “13 Hours Before the Crash” Yee, Corn 2011 BRAVO “Benefits of Cat Cuddling” Laddie, Kat 2013 Applle ::migrations Monday, July 15, 13
  2. benefits • reduce data redundancy • reduce input errors •

    maintain dependencies • easier to query • generally a faster databases • DRY - “don’t repeat yourself” Monday, July 15, 13
  3. title author year published shelf “How to Cure Headaches” Yee,

    Corn 2010 Apple “Healthy Sleeping” Boo, Honey 2012 aple “13 Hours Before the Crash” Yee, Corn 2011 BRAVO “Benefits of Cat Cuddling” Laddie, Kat 2012 Applle example table Monday, July 15, 13
  4. title author year published shelf “How to Cure Headaches” Yee,

    Corn 2010 Apple “Healthy Sleeping” Boo, Honey 2012 aple “13 Hours Before the Crash” Yee, Corn 2011 BRAVO “Benefits of Cat Cuddling” Laddie, Kat 2012 Applle not normalized Monday, July 15, 13
  5. BookID Title AuthorID YearID ShelfID 1 “How to Cure Headaches”

    1 1 1 2 “Healthy Sleeping” 2 3 1 3 “13 Hours Before the Crash” 1 2 2 4 “Benefits of Cat Cuddling” 3 3 1 AuthorID LastName FirstName 1 Yee Corn 2 Boo Honey 3 Laddie Kat ShelfID Shelf 1 Apple 2 Bravo YearID Year 1 2010 2 2011 3 2012 normalized Monday, July 15, 13
  6. Books BookID Title AuthorID YearID ShelfID Authors AuthorID LastName FirstName

    Years YearID Year Shelves ShelfID Shelf Monday, July 15, 13
  7. BookID Title AuthorID YearID ShelfID 1 “How to Cure Headaches”

    1 1 1 2 “Healthy Sleeping” 2 3 1 3 “13 Hours Before the Crash” 1 2 2 4 “Benefits of Cat Cuddling” 3 3 1 AuthorI D LastName FirstName 1 Yee Corn 2 Boo Honey 3 Laddie Kat ShelfID Shelf 1 Apple 2 Bravo YearID Year 1 2010 2 2011 3 2012 comparison title author year published shelf “How to Cure Headaches” Yee, Corn 2010 Apple “Healthy Sleeping” Boo, Honey 2012 aple “13 Hours Before the Crash” Yee, Corn 2011 BRAVO “Benefits of Cat Cuddling” Laddie, Kat 2012 Applle not normalized normalized Monday, July 15, 13
  8. • reduce data redundancy • reduce input errors • maintain

    dependencies • easier to query • generally a faster databases • DRY - “don’t repeat yourself” again, why? Monday, July 15, 13