SlideShare a Scribd company logo
MUSIC DATABASE EXAMPLE
     ( loosely based on the web site allmusic.com )

1. Entity-Relationship Diagram

The following is the list of main entities:




The following is the main relationships:
2. Relational Model


We now convert this E/R diagram to the relational model. Below is the complete
list of relations. The meaning of each relation is explained in detail in the next
section.


Label( Name, Decades )
Genre( Name, Summary )
Style( Name, Summary, Genre, MainStyle )
Artist( Name, YearFounded, Origin, Tones, Biography )
Song( Id, Name, DateComposed )
Album( Id, Title, Duration, Rating, Review, ReleaseDate, Tones, Type, Artist,
Year, LabelName )
Track( Album, TrackId, Recommended, Song )
RepresentativeAlbum( Album, Style, Decade )
SimilarArtist( ToA, ToY, FromA, FromY )
MajorContributor( McA, McY, McOfA, McOfY )
MemberOf( MA, MY, GA, GY )
Influence( Artist, Year, InfluencedA, InfluencedY )
AlbumStyle( Album, Style )
RelatedStyle( FromStyle, ToStyle )
MajorArtist( Artist, Year, Label )
RecordsGenre( Label, Genre )
AppearOn( Artist, Year, Album, TrackId )
LyricsBy( Song, Artist, Year )
MusicBy(Song, Artist, Year )




Foreign Keys:
Notation: R(A,B)       S(C,D) means attributes A and B of relation R (together) is a
                    




foreign key referencing attributes C and D of S (respectively).
•   Style(Genre)                       Genre(Name)
                        




•   Album(Artist, Year)                                                      Artist(Name, YearFounded)
                                                  




•   Album(LabelName)                                                             Label(Name)
                                                          




•   Track(Album)                       Album(Id)
                            




•   Track(Song)                    Song(Id)
                    




•   RepresentativeAlbum(Album)                                                                                               Album(Id)
                                                                                                                        




•   RepresentativeAlbum(Style)                                                                                              Style(Name)
                                                                                                            




•   SimilarArtist(ToA, ToY)                                                                          Artist(Name, YearFounded)
                                                                                          




•   SimilarArtist(FromA, FromY)                                                                                             Artist(Name, YearFounded)
                                                                                                                




•   MajorContributor(McA, McY)                                                                                              Artist(Name, YearFounded)
                                                                                                                    




•   MajorContributor(McOfA, McOfY)                                                                                                    Artist(Name, YearFounded)
                                                                                                                               




•   MemberOf(MA, MY)                                                                 Artist(Name, YearFounded)
                                                                  




•   MemberOf(GA, GY)                                                                 Artist(Name, YearFounded)
                                                              




•   Influence(A, Y)                     Artist(Name, YearFounded)
                                




•   Influence(InfluencedA, InfluencedY)                                                                                                 Artist(Name, YearFounded)
                                                                                                                                   




•   AlbumStyle(Album)                                                            Album(Id)
                                                      




•   AlbumStyle(Style)                                                Style(Name)
                                             




•   RelatedStyle(FromStyle)                                                                                Style(Name)
                                                                                                  




•   RelatedStyle(ToStyle)                                                                            Style(Name)
                                                                              




•   MajorArtist(Artist, Year)                                                                         Artist(Name, YearFounded)
                                                                                              




•   MajorArtist(Label)                                               Label(Name)
                                         




•   RecordsGenre(Label)                                                                          Label(Name)
                                                                          




•   RecordsGenre(Genre)                                                                              Genre(Name)
                                                                                  




•   AppearOn(Artist, Year)                                                                           Artist(Artist, YearFounded)
                                                                                      




•   AppearOn(Album, TrackId)                                                                                               Track(Album, TrackId)
                                                                                                        




•   LyricsBy(Song)                              Song(Id)
                                    




•   LyricsBy(Artist, Year)                                                                       Artist(Artist, YearFounded)
                                                                      




•   MusicBy(Song)                               Song(Id)
                                    




•   MusicBy(Artist, Year)                                                                        Artist(Artist, YearFounded)
                                                                      
Details of the above relations:


Label( Name, Decades )
      Stores the name of recording label and the years it was active as a single
      string containing all the decades.


Genre( Name, Summary )
      Stores information about music genre (such as rock, jazz, pop, etc.)


Style( Name, Summary, Genre, Main-style )
      Stores information about various styles of a specific genre (such as folk-
      rock, heavy-metal, indie-rock, etc.). “Main-genre” is a Boolean field that
      refers to whether a specific style is considered a “main-style of its genre.
      Note that the E/R data model requires each genre to have 5 to 10 main
      styles. However, this constraint is not translated to the relational schema.
      This constraint has to be enforced in another way.


Artist( Name, YearFounded, Origin, Tones, Biography )
      Stores information about an artist or a music group. The list of group
      members can be found using the “MemberOf” relation. The attribute origin
      lists the country the artist is from and tones is a string containing all the
      tones that describe the music of this artist (such as Reflective, Intense,
      Plaintive, Wistful, Paranoid, Gloomy, etc.).


Song( Id, Name, DateComposed )
      Stores information about various songs.


Album( Id, Title, Duration, Rating, Review, ReleaseDate, Tones, Type, Artist,
Year, LabelName )
      Stores information about an album. If the album was released by a
      specific artist, then the “Artist, Year” fields point to the corresponding artist
      in the artist relation. If this is a compilation of tracks performed by various
artists, then “Artist, Year” fields are left empty. The performer of each track
      is then stored in the “AppearOn” relation. If the album belongs to a single
      artist, then the “AppearOn” relation stores information about various guest
      artists for specific tracks.


Track( Album, TrackId, Recommended, Song )
      Information about specific tracks of an album. The Boolean field
      “Recommended” determines whether this is a recommended track or not.
      Song is a foreign key referring to the song that was features on that track.


RepresentativeAlbum( Album, Style, Decade )
      For each style and decade (1910s, 1920s,…), the relation lists a number
      of albums are representative of this style at that given decade.


SimilarArtist( ToA, ToY, FromA, FromY )
      Asserts that Artist(ToA,ToY) is similar to Artist(FromA, FromY). Note that
      the reverse may not necessarily be true.
      Recall: you need to attributes to refer to a specific artist in the artist
      relation due to its primary key.


MajorContributor( McA, McY, McOfA, McOfY )
      Asserts that Artist(McA, McY) was a major contributor of the music of
      Artist(McOfA, McOfY).


MemberOf( MA, MY, GA, GY )
      Asserts that Artist(MA, MY) is a member of music group given by
      Artist(GA, GY).


Influence( Artist, Year, InfluencedA, InfluencedY )
      Asserts that Artist(Artist, Year) is a major influence for Artist(InfluencedA,
      InfluencedY).
AlbumStyle( Album, Style )
       Asserts that an Album belongs to a specific style.


RelatedStyle( FromStyle, ToStyle )
       Asserts that “FromStyle” is related to “ToStyle”. The reverse may not
       necessarily be true.
MajorArtist( Artist, Year, Label )
       Asserts that Artist(Artist, Year) is a major artist of a specific recording
       label.


RecordsGenre( Label, Genre )
       Asserts that a label records music of a specific genre.


AppearOn( Artist, Year, Album, TrackId )
       Asserts that a specific Artist(Artist, Year) appear on a specific track of an
       album. This table is used to store information about the guest artists and
       compilation CDs (featuring a different artist on each track).


LyricsBy( Song, Artist, Year )
       Asserts that the lyrics to a specific song was written by an Artist(Artist,
       Year).


MusicBy( Song, Artist, Year )
       Asserts that the music for a specific song was composed by an
       Artist(Artist, Year).
       Note that by the data model, a song may be written/composed by multiple
       artists.

More Related Content

Viewers also liked

Final presentation
Final presentationFinal presentation
Final presentation
bridgetobrien2
 
Meeting minutes 17
Meeting minutes 17Meeting minutes 17
Meeting minutes 17
Visho Ravindran
 
Weatherandmood
WeatherandmoodWeatherandmood
Weatherandmood
mstruble
 
Meeting minutes 7
Meeting minutes 7Meeting minutes 7
Meeting minutes 7
Visho Ravindran
 
World Report on Disability
World Report on DisabilityWorld Report on Disability
World Report on Disability
buxybiz
 
Twitter2
Twitter2Twitter2
Twitter2
bridgetobrien2
 
Chapter 7 family
Chapter 7 familyChapter 7 family
Chapter 7 family
bridgetobrien2
 
Weatherandmood
WeatherandmoodWeatherandmood
Weatherandmood
mstruble
 
Glam up in Style
Glam up in StyleGlam up in Style
Glam up in Style
robinjackson708
 
Screen heros
Screen herosScreen heros
Screen heros
Bobby Somers
 
Zong 100519023528-phpapp02
Zong 100519023528-phpapp02Zong 100519023528-phpapp02
Zong 100519023528-phpapp02
Syed Hasan
 
Meeting minutes 15
Meeting minutes 15Meeting minutes 15
Meeting minutes 15
Visho Ravindran
 
North east asian geography
North east asian geographyNorth east asian geography
North east asian geography
Marilynarroyo123
 
Solar cell
Solar cellSolar cell
Solar cell
nn95829582
 
안드로이드 리스트뷰 최적화 사례 연구
안드로이드 리스트뷰 최적화 사례 연구안드로이드 리스트뷰 최적화 사례 연구
안드로이드 리스트뷰 최적화 사례 연구
Hyun Cheol
 
Technology will destroy our planet
Technology will destroy our planetTechnology will destroy our planet
Technology will destroy our planet
StudentXIII
 

Viewers also liked (16)

Final presentation
Final presentationFinal presentation
Final presentation
 
Meeting minutes 17
Meeting minutes 17Meeting minutes 17
Meeting minutes 17
 
Weatherandmood
WeatherandmoodWeatherandmood
Weatherandmood
 
Meeting minutes 7
Meeting minutes 7Meeting minutes 7
Meeting minutes 7
 
World Report on Disability
World Report on DisabilityWorld Report on Disability
World Report on Disability
 
Twitter2
Twitter2Twitter2
Twitter2
 
Chapter 7 family
Chapter 7 familyChapter 7 family
Chapter 7 family
 
Weatherandmood
WeatherandmoodWeatherandmood
Weatherandmood
 
Glam up in Style
Glam up in StyleGlam up in Style
Glam up in Style
 
Screen heros
Screen herosScreen heros
Screen heros
 
Zong 100519023528-phpapp02
Zong 100519023528-phpapp02Zong 100519023528-phpapp02
Zong 100519023528-phpapp02
 
Meeting minutes 15
Meeting minutes 15Meeting minutes 15
Meeting minutes 15
 
North east asian geography
North east asian geographyNorth east asian geography
North east asian geography
 
Solar cell
Solar cellSolar cell
Solar cell
 
안드로이드 리스트뷰 최적화 사례 연구
안드로이드 리스트뷰 최적화 사례 연구안드로이드 리스트뷰 최적화 사례 연구
안드로이드 리스트뷰 최적화 사례 연구
 
Technology will destroy our planet
Technology will destroy our planetTechnology will destroy our planet
Technology will destroy our planet
 

Recently uploaded

How to Fix [Errno 98] address already in use
How to Fix [Errno 98] address already in useHow to Fix [Errno 98] address already in use
How to Fix [Errno 98] address already in use
Celine George
 
How to Download & Install Module From the Odoo App Store in Odoo 17
How to Download & Install Module From the Odoo App Store in Odoo 17How to Download & Install Module From the Odoo App Store in Odoo 17
How to Download & Install Module From the Odoo App Store in Odoo 17
Celine George
 
Oliver Asks for More by Charles Dickens (9)
Oliver Asks for More by Charles Dickens (9)Oliver Asks for More by Charles Dickens (9)
Oliver Asks for More by Charles Dickens (9)
nitinpv4ai
 
THE SACRIFICE HOW PRO-PALESTINE PROTESTS STUDENTS ARE SACRIFICING TO CHANGE T...
THE SACRIFICE HOW PRO-PALESTINE PROTESTS STUDENTS ARE SACRIFICING TO CHANGE T...THE SACRIFICE HOW PRO-PALESTINE PROTESTS STUDENTS ARE SACRIFICING TO CHANGE T...
THE SACRIFICE HOW PRO-PALESTINE PROTESTS STUDENTS ARE SACRIFICING TO CHANGE T...
indexPub
 
How to Setup Default Value for a Field in Odoo 17
How to Setup Default Value for a Field in Odoo 17How to Setup Default Value for a Field in Odoo 17
How to Setup Default Value for a Field in Odoo 17
Celine George
 
The basics of sentences session 7pptx.pptx
The basics of sentences session 7pptx.pptxThe basics of sentences session 7pptx.pptx
The basics of sentences session 7pptx.pptx
heathfieldcps1
 
BIOLOGY NATIONAL EXAMINATION COUNCIL (NECO) 2024 PRACTICAL MANUAL.pptx
BIOLOGY NATIONAL EXAMINATION COUNCIL (NECO) 2024 PRACTICAL MANUAL.pptxBIOLOGY NATIONAL EXAMINATION COUNCIL (NECO) 2024 PRACTICAL MANUAL.pptx
BIOLOGY NATIONAL EXAMINATION COUNCIL (NECO) 2024 PRACTICAL MANUAL.pptx
RidwanHassanYusuf
 
BÀI TẬP BỔ TRỢ TIẾNG ANH LỚP 8 - CẢ NĂM - FRIENDS PLUS - NĂM HỌC 2023-2024 (B...
BÀI TẬP BỔ TRỢ TIẾNG ANH LỚP 8 - CẢ NĂM - FRIENDS PLUS - NĂM HỌC 2023-2024 (B...BÀI TẬP BỔ TRỢ TIẾNG ANH LỚP 8 - CẢ NĂM - FRIENDS PLUS - NĂM HỌC 2023-2024 (B...
BÀI TẬP BỔ TRỢ TIẾNG ANH LỚP 8 - CẢ NĂM - FRIENDS PLUS - NĂM HỌC 2023-2024 (B...
Nguyen Thanh Tu Collection
 
SWOT analysis in the project Keeping the Memory @live.pptx
SWOT analysis in the project Keeping the Memory @live.pptxSWOT analysis in the project Keeping the Memory @live.pptx
SWOT analysis in the project Keeping the Memory @live.pptx
zuzanka
 
Skimbleshanks-The-Railway-Cat by T S Eliot
Skimbleshanks-The-Railway-Cat by T S EliotSkimbleshanks-The-Railway-Cat by T S Eliot
Skimbleshanks-The-Railway-Cat by T S Eliot
nitinpv4ai
 
Wound healing PPT
Wound healing PPTWound healing PPT
Wound healing PPT
Jyoti Chand
 
Level 3 NCEA - NZ: A Nation In the Making 1872 - 1900 SML.ppt
Level 3 NCEA - NZ: A  Nation In the Making 1872 - 1900 SML.pptLevel 3 NCEA - NZ: A  Nation In the Making 1872 - 1900 SML.ppt
Level 3 NCEA - NZ: A Nation In the Making 1872 - 1900 SML.ppt
Henry Hollis
 
مصحف القراءات العشر أعد أحرف الخلاف سمير بسيوني.pdf
مصحف القراءات العشر   أعد أحرف الخلاف سمير بسيوني.pdfمصحف القراءات العشر   أعد أحرف الخلاف سمير بسيوني.pdf
مصحف القراءات العشر أعد أحرف الخلاف سمير بسيوني.pdf
سمير بسيوني
 
A Visual Guide to 1 Samuel | A Tale of Two Hearts
A Visual Guide to 1 Samuel | A Tale of Two HeartsA Visual Guide to 1 Samuel | A Tale of Two Hearts
A Visual Guide to 1 Samuel | A Tale of Two Hearts
Steve Thomason
 
A Free 200-Page eBook ~ Brain and Mind Exercise.pptx
A Free 200-Page eBook ~ Brain and Mind Exercise.pptxA Free 200-Page eBook ~ Brain and Mind Exercise.pptx
A Free 200-Page eBook ~ Brain and Mind Exercise.pptx
OH TEIK BIN
 
How to Manage Reception Report in Odoo 17
How to Manage Reception Report in Odoo 17How to Manage Reception Report in Odoo 17
How to Manage Reception Report in Odoo 17
Celine George
 
MDP on air pollution of class 8 year 2024-2025
MDP on air pollution of class 8 year 2024-2025MDP on air pollution of class 8 year 2024-2025
MDP on air pollution of class 8 year 2024-2025
khuleseema60
 
Educational Technology in the Health Sciences
Educational Technology in the Health SciencesEducational Technology in the Health Sciences
Educational Technology in the Health Sciences
Iris Thiele Isip-Tan
 
Observational Learning
Observational Learning Observational Learning
Observational Learning
sanamushtaq922
 
Standardized tool for Intelligence test.
Standardized tool for Intelligence test.Standardized tool for Intelligence test.
Standardized tool for Intelligence test.
deepaannamalai16
 

Recently uploaded (20)

How to Fix [Errno 98] address already in use
How to Fix [Errno 98] address already in useHow to Fix [Errno 98] address already in use
How to Fix [Errno 98] address already in use
 
How to Download & Install Module From the Odoo App Store in Odoo 17
How to Download & Install Module From the Odoo App Store in Odoo 17How to Download & Install Module From the Odoo App Store in Odoo 17
How to Download & Install Module From the Odoo App Store in Odoo 17
 
Oliver Asks for More by Charles Dickens (9)
Oliver Asks for More by Charles Dickens (9)Oliver Asks for More by Charles Dickens (9)
Oliver Asks for More by Charles Dickens (9)
 
THE SACRIFICE HOW PRO-PALESTINE PROTESTS STUDENTS ARE SACRIFICING TO CHANGE T...
THE SACRIFICE HOW PRO-PALESTINE PROTESTS STUDENTS ARE SACRIFICING TO CHANGE T...THE SACRIFICE HOW PRO-PALESTINE PROTESTS STUDENTS ARE SACRIFICING TO CHANGE T...
THE SACRIFICE HOW PRO-PALESTINE PROTESTS STUDENTS ARE SACRIFICING TO CHANGE T...
 
How to Setup Default Value for a Field in Odoo 17
How to Setup Default Value for a Field in Odoo 17How to Setup Default Value for a Field in Odoo 17
How to Setup Default Value for a Field in Odoo 17
 
The basics of sentences session 7pptx.pptx
The basics of sentences session 7pptx.pptxThe basics of sentences session 7pptx.pptx
The basics of sentences session 7pptx.pptx
 
BIOLOGY NATIONAL EXAMINATION COUNCIL (NECO) 2024 PRACTICAL MANUAL.pptx
BIOLOGY NATIONAL EXAMINATION COUNCIL (NECO) 2024 PRACTICAL MANUAL.pptxBIOLOGY NATIONAL EXAMINATION COUNCIL (NECO) 2024 PRACTICAL MANUAL.pptx
BIOLOGY NATIONAL EXAMINATION COUNCIL (NECO) 2024 PRACTICAL MANUAL.pptx
 
BÀI TẬP BỔ TRỢ TIẾNG ANH LỚP 8 - CẢ NĂM - FRIENDS PLUS - NĂM HỌC 2023-2024 (B...
BÀI TẬP BỔ TRỢ TIẾNG ANH LỚP 8 - CẢ NĂM - FRIENDS PLUS - NĂM HỌC 2023-2024 (B...BÀI TẬP BỔ TRỢ TIẾNG ANH LỚP 8 - CẢ NĂM - FRIENDS PLUS - NĂM HỌC 2023-2024 (B...
BÀI TẬP BỔ TRỢ TIẾNG ANH LỚP 8 - CẢ NĂM - FRIENDS PLUS - NĂM HỌC 2023-2024 (B...
 
SWOT analysis in the project Keeping the Memory @live.pptx
SWOT analysis in the project Keeping the Memory @live.pptxSWOT analysis in the project Keeping the Memory @live.pptx
SWOT analysis in the project Keeping the Memory @live.pptx
 
Skimbleshanks-The-Railway-Cat by T S Eliot
Skimbleshanks-The-Railway-Cat by T S EliotSkimbleshanks-The-Railway-Cat by T S Eliot
Skimbleshanks-The-Railway-Cat by T S Eliot
 
Wound healing PPT
Wound healing PPTWound healing PPT
Wound healing PPT
 
Level 3 NCEA - NZ: A Nation In the Making 1872 - 1900 SML.ppt
Level 3 NCEA - NZ: A  Nation In the Making 1872 - 1900 SML.pptLevel 3 NCEA - NZ: A  Nation In the Making 1872 - 1900 SML.ppt
Level 3 NCEA - NZ: A Nation In the Making 1872 - 1900 SML.ppt
 
مصحف القراءات العشر أعد أحرف الخلاف سمير بسيوني.pdf
مصحف القراءات العشر   أعد أحرف الخلاف سمير بسيوني.pdfمصحف القراءات العشر   أعد أحرف الخلاف سمير بسيوني.pdf
مصحف القراءات العشر أعد أحرف الخلاف سمير بسيوني.pdf
 
A Visual Guide to 1 Samuel | A Tale of Two Hearts
A Visual Guide to 1 Samuel | A Tale of Two HeartsA Visual Guide to 1 Samuel | A Tale of Two Hearts
A Visual Guide to 1 Samuel | A Tale of Two Hearts
 
A Free 200-Page eBook ~ Brain and Mind Exercise.pptx
A Free 200-Page eBook ~ Brain and Mind Exercise.pptxA Free 200-Page eBook ~ Brain and Mind Exercise.pptx
A Free 200-Page eBook ~ Brain and Mind Exercise.pptx
 
How to Manage Reception Report in Odoo 17
How to Manage Reception Report in Odoo 17How to Manage Reception Report in Odoo 17
How to Manage Reception Report in Odoo 17
 
MDP on air pollution of class 8 year 2024-2025
MDP on air pollution of class 8 year 2024-2025MDP on air pollution of class 8 year 2024-2025
MDP on air pollution of class 8 year 2024-2025
 
Educational Technology in the Health Sciences
Educational Technology in the Health SciencesEducational Technology in the Health Sciences
Educational Technology in the Health Sciences
 
Observational Learning
Observational Learning Observational Learning
Observational Learning
 
Standardized tool for Intelligence test.
Standardized tool for Intelligence test.Standardized tool for Intelligence test.
Standardized tool for Intelligence test.
 

Music example

  • 1. MUSIC DATABASE EXAMPLE ( loosely based on the web site allmusic.com ) 1. Entity-Relationship Diagram The following is the list of main entities: The following is the main relationships:
  • 2. 2. Relational Model We now convert this E/R diagram to the relational model. Below is the complete list of relations. The meaning of each relation is explained in detail in the next section. Label( Name, Decades ) Genre( Name, Summary ) Style( Name, Summary, Genre, MainStyle ) Artist( Name, YearFounded, Origin, Tones, Biography ) Song( Id, Name, DateComposed ) Album( Id, Title, Duration, Rating, Review, ReleaseDate, Tones, Type, Artist, Year, LabelName ) Track( Album, TrackId, Recommended, Song ) RepresentativeAlbum( Album, Style, Decade ) SimilarArtist( ToA, ToY, FromA, FromY ) MajorContributor( McA, McY, McOfA, McOfY ) MemberOf( MA, MY, GA, GY ) Influence( Artist, Year, InfluencedA, InfluencedY ) AlbumStyle( Album, Style ) RelatedStyle( FromStyle, ToStyle ) MajorArtist( Artist, Year, Label ) RecordsGenre( Label, Genre ) AppearOn( Artist, Year, Album, TrackId ) LyricsBy( Song, Artist, Year ) MusicBy(Song, Artist, Year ) Foreign Keys: Notation: R(A,B) S(C,D) means attributes A and B of relation R (together) is a   foreign key referencing attributes C and D of S (respectively).
  • 3. Style(Genre) Genre(Name)   • Album(Artist, Year) Artist(Name, YearFounded)   • Album(LabelName) Label(Name)   • Track(Album) Album(Id)   • Track(Song) Song(Id)   • RepresentativeAlbum(Album) Album(Id)   • RepresentativeAlbum(Style) Style(Name)   • SimilarArtist(ToA, ToY) Artist(Name, YearFounded)   • SimilarArtist(FromA, FromY) Artist(Name, YearFounded)   • MajorContributor(McA, McY) Artist(Name, YearFounded)   • MajorContributor(McOfA, McOfY) Artist(Name, YearFounded)   • MemberOf(MA, MY) Artist(Name, YearFounded)   • MemberOf(GA, GY) Artist(Name, YearFounded)   • Influence(A, Y) Artist(Name, YearFounded)   • Influence(InfluencedA, InfluencedY) Artist(Name, YearFounded)   • AlbumStyle(Album) Album(Id)   • AlbumStyle(Style) Style(Name)   • RelatedStyle(FromStyle) Style(Name)   • RelatedStyle(ToStyle) Style(Name)   • MajorArtist(Artist, Year) Artist(Name, YearFounded)   • MajorArtist(Label) Label(Name)   • RecordsGenre(Label) Label(Name)   • RecordsGenre(Genre) Genre(Name)   • AppearOn(Artist, Year) Artist(Artist, YearFounded)   • AppearOn(Album, TrackId) Track(Album, TrackId)   • LyricsBy(Song) Song(Id)   • LyricsBy(Artist, Year) Artist(Artist, YearFounded)   • MusicBy(Song) Song(Id)   • MusicBy(Artist, Year) Artist(Artist, YearFounded)  
  • 4. Details of the above relations: Label( Name, Decades ) Stores the name of recording label and the years it was active as a single string containing all the decades. Genre( Name, Summary ) Stores information about music genre (such as rock, jazz, pop, etc.) Style( Name, Summary, Genre, Main-style ) Stores information about various styles of a specific genre (such as folk- rock, heavy-metal, indie-rock, etc.). “Main-genre” is a Boolean field that refers to whether a specific style is considered a “main-style of its genre. Note that the E/R data model requires each genre to have 5 to 10 main styles. However, this constraint is not translated to the relational schema. This constraint has to be enforced in another way. Artist( Name, YearFounded, Origin, Tones, Biography ) Stores information about an artist or a music group. The list of group members can be found using the “MemberOf” relation. The attribute origin lists the country the artist is from and tones is a string containing all the tones that describe the music of this artist (such as Reflective, Intense, Plaintive, Wistful, Paranoid, Gloomy, etc.). Song( Id, Name, DateComposed ) Stores information about various songs. Album( Id, Title, Duration, Rating, Review, ReleaseDate, Tones, Type, Artist, Year, LabelName ) Stores information about an album. If the album was released by a specific artist, then the “Artist, Year” fields point to the corresponding artist in the artist relation. If this is a compilation of tracks performed by various
  • 5. artists, then “Artist, Year” fields are left empty. The performer of each track is then stored in the “AppearOn” relation. If the album belongs to a single artist, then the “AppearOn” relation stores information about various guest artists for specific tracks. Track( Album, TrackId, Recommended, Song ) Information about specific tracks of an album. The Boolean field “Recommended” determines whether this is a recommended track or not. Song is a foreign key referring to the song that was features on that track. RepresentativeAlbum( Album, Style, Decade ) For each style and decade (1910s, 1920s,…), the relation lists a number of albums are representative of this style at that given decade. SimilarArtist( ToA, ToY, FromA, FromY ) Asserts that Artist(ToA,ToY) is similar to Artist(FromA, FromY). Note that the reverse may not necessarily be true. Recall: you need to attributes to refer to a specific artist in the artist relation due to its primary key. MajorContributor( McA, McY, McOfA, McOfY ) Asserts that Artist(McA, McY) was a major contributor of the music of Artist(McOfA, McOfY). MemberOf( MA, MY, GA, GY ) Asserts that Artist(MA, MY) is a member of music group given by Artist(GA, GY). Influence( Artist, Year, InfluencedA, InfluencedY ) Asserts that Artist(Artist, Year) is a major influence for Artist(InfluencedA, InfluencedY).
  • 6. AlbumStyle( Album, Style ) Asserts that an Album belongs to a specific style. RelatedStyle( FromStyle, ToStyle ) Asserts that “FromStyle” is related to “ToStyle”. The reverse may not necessarily be true. MajorArtist( Artist, Year, Label ) Asserts that Artist(Artist, Year) is a major artist of a specific recording label. RecordsGenre( Label, Genre ) Asserts that a label records music of a specific genre. AppearOn( Artist, Year, Album, TrackId ) Asserts that a specific Artist(Artist, Year) appear on a specific track of an album. This table is used to store information about the guest artists and compilation CDs (featuring a different artist on each track). LyricsBy( Song, Artist, Year ) Asserts that the lyrics to a specific song was written by an Artist(Artist, Year). MusicBy( Song, Artist, Year ) Asserts that the music for a specific song was composed by an Artist(Artist, Year). Note that by the data model, a song may be written/composed by multiple artists.