Database Normalization Five 'rules' to make data normal: 1NF,2NF,...,5NF (NF=normal form) - each rule builds on another, starting from 1NF - 1NF/2NF/3NF -> Core Basics (normalization usually means 3NF!) - 4NF/5NF -> Exceptions *Note: Normalization is about grouping & connecting data the right way! 1NF is about - atomic values - unique identifiers *Term: Imagine a spreadsheet -> [table] or [entity] 1NF rules - a cell cannot contain more than 1 value = if it does, that column needs to be split into multiple columns - each row (@record) must be unique = look for potential primary key = usually, we use system-generated (integers are better!) - each column name must be unique - there must be no repeating groups (or cells?) = it there are, remove and create new table (1NF!) 2NF rule - all data/column(s) must depend on the primary key = if it does not, must be split into it own table (1NF!) = use primary key in new table as column value -> foreign key 3NF rule - primary key must define all non-key column(s) = non-key column(s) must not depend on any other key = if this is not met, must create new table and use foreign key to link