Eli5: Database Normalization

130 views

Every time I think I got it, I’m getting lost along the way. Please help!

In: 1

4 Answers

Anonymous 0 Comments

Imagine you have a database which is just a text file, and you just put everything related in a single line:

ID Data
1 John Doe, aged 38, lives in Seattle, earns 58k a year, works at Meta
2 Jane Doe, aged 34, lives in Melbourne, earns 55k a year, works at IBM

This is not normalized – there are lots of stuff crammed per entry. What if IBM changed their company name? You’d have to iterate every single entry and correct the name as you go.

When database gets normalized, we pull out data to different tables. Let’s make a new table for each company:

ID Name
1 IBM
2 Meta
3 Alphabet

Now, we can remove the company information that’s written in the “Data” column and add a new column that references the company table:

ID Data Company
1 John Doe, aged 38, lives in Seattle, earns 58k a year 2
2 Jane Doe, aged 34, lives in Melbourne, earns 55k a year 1

Little by little, we can move stuff to their own tables. This is what database normalization is (lots of things omitted for simplicity’s sake).

There are various levels of normalization, but those aren’t really ELI5 stuff.

You are viewing 1 out of 4 answers, click here to view all answers.