Содержание
- 2. Success criteria know what is normalization know the purpose of the 3 forms of normalization (1NF,
- 3. Database normalization is the process of removing redundant data from your tables in to improve storage
- 4. 1NF - Atomic Data Test If a table has a primary key it is said to
- 6. Take the following table. StudentID is the primary key. Is it 1NF?
- 7. No. There are repeating groups (subject, subjectcost, grade) How can you make it 1NF?
- 8. Create new rows so each cell contains only one value But now look – is the
- 9. No – the studentID no longer uniquely identifies each row You now need to declare studentID
- 10. So. We now have 1NF. Is it 2NF?
- 11. Studentname and address are dependent on studentID (which is part of the key) This is good.
- 12. And 2NF requires… All non-key fields are dependent on the ENTIRE key (studentID + subject)
- 13. So it’s not 2NF How can we fix it?
- 14. Make new tables Make a new table for each primary key field Give each new table
- 15. Step 1 STUDENT TABLE (key = StudentID)
- 16. Step 2 STUDENT TABLE (key = StudentID) SUBJECTS TABLE (key = Subject)
- 17. Step 3 STUDENT TABLE (key = StudentID) SUBJECTS TABLE (key = Subject) RESULTS TABLE (key =
- 18. Step 3 STUDENT TABLE (key = StudentID) SUBJECTS TABLE (key = Subject) RESULTS TABLE (key =
- 19. Step 4 - relationships STUDENT TABLE (key = StudentID) SUBJECTS TABLE (key = Subject) RESULTS TABLE
- 20. Step 4 - cardinality STUDENT TABLE (key = StudentID) SUBJECTS TABLE (key = Subject) RESULTS TABLE
- 21. Step 4 - cardinality STUDENT TABLE (key = StudentID) SUBJECTS TABLE (key = Subject) RESULTS TABLE
- 22. Step 4 - cardinality STUDENT TABLE (key = StudentID) SUBJECTS TABLE (key = Subject) RESULTS TABLE
- 23. Step 4 - cardinality STUDENT TABLE (key = StudentID) SUBJECTS TABLE (key = Subject) RESULTS TABLE
- 24. A 2NF check STUDENT TABLE (key = StudentID) SUBJECTS TABLE (key = Subject) RESULTS TABLE (key
- 25. A 2NF check STUDENT TABLE (key = StudentID) SUBJECTS TABLE (key = Subject) RESULTS TABLE (key
- 26. A 2NF check STUDENT TABLE (key = StudentID) SUBJECTS TABLE (key = Subject) RESULTS TABLE (key
- 27. But is it 3NF? STUDENT TABLE (key = StudentID) SUBJECTS TABLE (key = Subject) RESULTS TABLE
- 28. A 3NF check STUDENT TABLE (key = StudentID) SUBJECTS TABLE (key = Subject) RESULTS TABLE (key
- 29. A 3NF check STUDENT TABLE (key = StudentID) SUBJECTS TABLE (key = Subject) RESULTS TABLE (key
- 30. A 3NF check STUDENT TABLE (key = StudentID) SUBJECTS TABLE (key = Subject) RESULTS TABLE (key
- 31. A 3NF check STUDENT TABLE (key = StudentID) SUBJECTS TABLE (key = Subject) RESULTS TABLE (key
- 32. A 3NF check STUDENT TABLE (key = StudentID) SUBJECTS TABLE (key = Subject) RESULTS TABLE (key
- 33. A 3NF check STUDENT TABLE (key = StudentID) SUBJECTS TABLE (key = Subject) RESULTS TABLE (key
- 34. Again, carve off the offending fields SUBJECTS TABLE (key = Subject) RESULTS TABLE (key = StudentID+Subject)
- 35. A 3NF fix SUBJECTS TABLE (key = Subject) RESULTS TABLE (key = StudentID+Subject) 1 1 8
- 36. A 3NF fix SUBJECTS TABLE (key = Subject) RESULTS TABLE (key = StudentID+Subject) 1 1 8
- 37. A 3NF win! Or…
- 39. Скачать презентацию