top of page

ER Diagram Example : Music Database

The music database stores details of a personal music library, and could be used to manage your MP3, CD, or vinyl collection. Because this database is for a personal collection, it’s relatively simple and stores only the relationships between artists, albums, and tracks. It ignores the requirements of many music genres, making it most useful for storing popular music and less useful for storing jazz or classical music.


We first draw up a clear list of requirements for our database:

  • The collection consists of albums.

  • An album is made by exactly one artist.

  • An artist makes one or more albums.

  • An album contains one or more tracks

  • Artists, albums, and tracks each have a name.

  • Each track is on exactly one album.

  • Each track has a time length, measured in seconds.

  • When a track is played, the date and time the playback began (to the nearest second) should be recorded; this is used for reporting when a track was last played, as well as the number of times music by an artist, from an album, or a track has been played.


There’s no requirement to capture composers, group members or sidemen, recording date or location, the source media, or any other details of artists, albums, or tracks.


The ER diagram derived from our requirements is shown in Figure. You’ll notice that it consists of only one-to-many relationships: one artist can make many albums, one album can contain many tracks, and one track can be played many times. Conversely, each play is associated with one track, a track is on one album, and an album is by one artist. The attributes are straightforward: artists, albums, and tracks have names, as well as identifiers to uniquely identify each entity. The track entity has a time attribute to store the duration, and the played entity has a timestamp to store when the track was played.







Source: oreilly


The Tech Platform



0 comments

Comments


bottom of page