In 1970, Edgar Codd published his landmark paper ‘A Relational Model of Data for Large Shared Data Banks’ where he defined relational databases as well as their normalization to first normal form (1NF) in section 1.4, page 381. It is a procedure for eliminating non-simple domains (domains whose elements are relations) from a set of relation schemata (i.e. a database schema) in order to allow simple two-dimensional array representations without pointers.
I have applied this 1NF normalization procedure to the following six database schemata modeling music recordings.
Italics denotes a key constraint.
R1 > R2 denotes a non-simple domain relationships such that the relation schema R1 has an attribute R2 whose domain constraint is described by the relation schema R2 (i.e. it is a relation-valued domain). For instance in Codd’s example, we have the following non-simple domain relationships: employee
> jobhistory
> salaryhistory
and employee
> children
.
Database schema 1
Unnormalized (non-simple domain relationships: artist
> album
> song
):
- artist(artist_id, artist_name, album);
- album(album_id, album_title, album_date, song);
- song (song_id, song_title).
Normalized (1NF):
- artist(artist_id, artist_name);
- album(artist_id, album_id, album_title, album_date);
- song(artist_id, album_id, song_id, song_title).
Database schema 2
Unnormalized (non-simple domain relationships: artist
> song
> album
):
- artist(artist_id, artist_name, song);
- song(song_id, song_title, album);
- album(album_id, album_title, album_date).
Normalized (1NF):
- artist(artist_id, artist_name);
- song(artist_id, song_id, song_title);
- album(artist_id, song_id, album_id, album_title, album_date).
Database schema 3
Unnormalized (non-simple domain relationships: album
> artist
> song
):
- album(album_id, album_title, album_date, artist);
- artist(artist_id, artist_name, song);
- song(song_id, song_title).
Normalized (1NF):
- album(album_id, album_title, album_date);
- artist(album_id, artist_id, artist_name);
- song(album_id, artist_id, song_id, song_title).
Database schema 4
Unnormalized (non-simple domain relationships: album
> song
> artist
):
- album(album_id, album_title, album_date, song);
- song(song_id, song_title, artist);
- artist(artist_id, artist_name).
Normalized (1NF):
- album(album_id, album_title, album_date);
- song(album_id, song_id, song_title);
- artist(album_id, song_id, artist_id, artist_name).
Database schema 5
Unnormalized (non-simple domain relationships: song
> artist
> album
):
- song(song_id, song_title, artist);
- artist(artist_id, artist_name, album);
- album(album_id, album_title, album_date).
Normalized (1NF):
- song(song_id, song_title);
- artist(song_id, artist_id, artist_name);
- album(song_id, artist_id, album_id, album_title, album_date).
Database schema 6
Unnormalized (non-simple domain relationships: song
> album
> artist
):
- song(song_id, song_title, album);
- album(album_id, album_title, album_date, artist);
- artist(artist_id, artist_name).
Normalized (1NF):
- song(song_id, song_title);
- album(song_id, album_id, album_title, album_date);
- artist(song_id, album_id, artist_id, artist_name).
Which of these six normalized database schemata makes more sense?