160 likes | 301 Views
Normalisation. Un-normalised. We know what data we want to store in our database Organise it into a table. Un-normalised. Un-normalised. Problem: We can’t store more than one piece of data in one field. First Normal Form. Rule: Remove all repeating groups. First Normal Form.
E N D
Un-normalised We know what data we want to store in our database Organise it into a table
Un-normalised Problem: We can’t store more than one piece of data in one field
First Normal Form Rule: Remove all repeating groups
First Normal Form Problems: We have empty fields? What happens if a student studies four courses? It’s really complicated to read
First Normal Form Problem: We have redundant information
Second Normal Form Rule: All non-key attributes are dependant on the whole primary key This means: Make sure all data refers only to the primary key and only the primary key
Second Normal Form Student Courses
Second Normal Form To make them talk to each other: Enrolment
Second Normal Form Problem: What happens if a tutor teaches more than one course? We get more repeating and redundancy
Third Normal Form Rule: No attributes are dependant on other non-key attributes This means: Make sure no data refers anything other than the primary key
Third Normal Form Student Course
Third Normal Form Tutor Enrolment