A music library contains several kinds of information.
For example:
You could place every detail about the artist and album directly into every song row.
That creates repetition.
Another approach is to keep separate records and connect them using IDs.
Suppose the Artists table contains:
| Artist ID | Artist Name |
|---|---|
| A001 | Dana Lee |
| A002 | Example Band |
Each artist record has a unique identifier.
Now consider a Songs table:
| Song ID | Title | Artist ID |
|---|---|---|
| S001 | Side Street | A001 |
| S002 | Northern Lights | A002 |
The Artist ID in each song record connects the song to one artist record.
For:
Song ID = S002
Title = Northern Lights
Artist ID = A002
the value:
A002
points to the artist record:
Artist ID = A002
Artist Name = Example Band
That lets the dataset express:
Northern Lights is related to Example Band.
The relationship is represented through a shared identifier.
Without IDs, the song table might repeat:
Example Band
on many rows.
If the artist's name needs correction, many rows may need editing.
With a separate Artists table, the descriptive artist information can live in one artist record.
Songs can refer to that record by ID.
This can reduce duplication and improve consistency.
Suppose a song contains:
Artist ID = A099
but the Artists table has no record with A099.
The reference does not connect to a known artist record.
The structure may still look valid, but the relationship is broken.
Related-record IDs are useful only when they refer to actual intended records.
If the artist identifier is:
A002
then:
A02
is a different text value.
So is:
a002
in systems where case matters.
A relationship depends on matching the identifier according to the rules of the dataset.
Consistency matters.
Suppose Example Band has three songs:
| Song ID | Title | Artist ID |
|---|---|---|
| S002 | Northern Lights | A002 |
| S004 | Open Road | A002 |
| S009 | Winter Signal | A002 |
All three song records refer to the same Artist ID.
The artist record itself does not need to be duplicated.
This is a common data relationship:
one artist → many songs
You will model relationships more formally when you work with entity-relationship diagrams.
The Songs table might contain:
| Song ID | Title | Artist ID | Album ID |
|---|---|---|---|
| S002 | Northern Lights | A002 | AL05 |
Now the song refers to:
The record becomes connected to multiple kinds of data.
If the song contains:
Artist ID = A002
it does not contain the entire artist record.
It contains a value used to identify the related record.
The descriptive artist information remains in the Artists table.
That distinction is important.
A reference tells you which record to connect to.
It does not duplicate all information from that record.
Separating songs, artists, and albums would be inconvenient if the records could never be reconnected.
Identifiers make the separation useful.
Conceptually:
Songs.Artist ID
↓
Artists.Artist ID
and:
Songs.Album ID
↓
Albums.Album ID
The matching values create the connection.
At this stage, focus on the practical idea:
The next Learning Activity introduces the broader vocabulary of entities, attributes, and relationships.