Showing posts from February, 2023

Database Normalization

How to normalize databases several layers deep What is normalization? It’s a simple method of breaking up tables into smaller tables linking relationships to reduce data redundancy and eliminate insertion, update and deletion anomalies. There are a few keywords that we should gloss over first before we begin. ‘Non-Atomic’ is the word used to describe a data item that can be broken down further. Examples of non-atomic data A full name: John Hunt when a first name and surname is present in the database. A full address: 6 Picton Road, London, WR1 4PG. Data that is part of a larger dataset e.g Oxford Book club and Coventry Health club. Primary Key — Field in a table that uniquely identifies each record in the table, cannot be null and should be rarely changed. Foreign Key — Linking a table Primary Key to another table. Let’s get into the several layers of normalisation, starting with the First Normal Form. We will be using example tables on the left and the normalized tables on the rig