Normalization (P2) Flashcards
Normalization
When larger tables in a database are divided into smaller tables to improve data integrity and reduce data redundancy.
3 outlined reasons to use normalization
- Reduced data redundancy (saves up memory space)
- Reduced table complexity (Makes querying less error-prone)
- Makes sure data is stored logically (Makes querying more efficient)
1NF - 5 characteristics
- Eliminate duplicate attributes
- Eliminate attributes with multiple values (only atomic attributes)
- Create separate tables for each group of related data
- Ensure that there is a primary/composite key
- Ensure that all records are unique
2NF - 2 characteristics
- Meets all requirements for 1NF
- Eliminates partial dependency
3NF - 2 characteristics
- Meet all requirements for 2NF
- Eliminates transitive dependency
Partial Dependency
When a non-prime attribute is dependent on only part of a composite key
Transitive Dependency
When a non-prime attribute is dependent on another non-prime attribute which is dependent on the primary key
How to fix partial dependency, transitive dependency and what is similar in both solutions?
Partial dependency? 🔄 Split off attributes that depend on part of a composite key.
Transitive dependency? 🔁 Split off attributes that depend on another non-key attribute.
In both cases? ✅ Use foreign keys to keep the relationships intact.