Databases with SQLite

Normalization

An important process in the design of a database is called Normalization, which is what we'll discuss here.

This process ensures your data is defined and managed in a controlled and scalable manner.

Each table in the database is put through the process, but each one may be at different stages of normalization.

Most databases are brought up to 3NF level (but possibly up to 5 or 6!), so that is as far as we will travel here. Feel free to go deeper if you must.

If you neglect to do this process, you may find that you are having problems with SQL queries to the database, and your results are difficult (or impossible) to achieve. That's a flag telling you it's time to adjust your database.


The point of Normalization is to ensure true data is not destroyed or false data is not created.

The database should represent a fact one way, one time, in one place. As a wise man once said, 'A man with 2 watches never knows what time it is.'

Many of the resources you may use will define 'normalization' in a jargon you probably won't understand unless you deeply understand formal relational database theory - which is something I do not have.

You are welcome to read the following definition of a third normal form and then explain what is meant by it:

A relation is in third normal form (3NF) if and only if, for all time, each tuple consists of a primary key value that identifies some entity, together with a set of zero or more mutually independent attribute values that describe that entity in some way.
* C.J. Date - An Introduction to Database Systems 6E

Yes, I thought so as well.

Instead, we will try to describe in simple terms what is required to get your database into a shape that conforms with these 3 conditions:

What we are trying to avoid are:

This should also ensure your database is easy to maintain; and is scalable.

First Normal Form