Ok, I'm trying to make a decent database for setlists for live shows (I would LOVE to make something like this but thats a little beyond my db capabilities). I've got my db set up (I hope) but this project is gonna require MANY complex queries. And I'm already stuck. I'll list the tables in question:
∙Venue(venue_id, name1, name2, name3, city, state, capacity, type)
∙Show(show_id, date, venue_id, tour_id, noSetlist?)
∙Song(song_id, s_name, album_id, isCover, original, isNotStudio)
∙ShowSongs(showSong_id, show_id, song_id, songNumber, isSegue, isCloser, isEncore1, isEncore2, isSetBreak, songDesc, songLength)
∙Personnel(person_id, p_name, p_instrument1, p_instrument2)
∙ShowPersonnel(personnelSong_id, show_id, song_id, personnel_id)
NOTE: there are 4 additional tables: Album, Tour, Guest, & ShowGuests
What I'm aiming for is a list that will contain one row for every song performed. In my database, I've entered 90 songs over 4 shows so the resulted table should have 90 rows. This SQL statement gets me everything I want except for the Personnel/ShowPersonnel info:
FYI, personnel is any guest who plays during the show. now, I basically want two extra columns appended to this list. Ever cell in these two new columns should be blank except for the the song in which the person guested. So far, everything I have tried has resulted in only displaying the one record where the person guested. Like this one:
Where am i going wrong?
∙Venue(venue_id, name1, name2, name3, city, state, capacity, type)
∙Show(show_id, date, venue_id, tour_id, noSetlist?)
∙Song(song_id, s_name, album_id, isCover, original, isNotStudio)
∙ShowSongs(showSong_id, show_id, song_id, songNumber, isSegue, isCloser, isEncore1, isEncore2, isSetBreak, songDesc, songLength)
∙Personnel(person_id, p_name, p_instrument1, p_instrument2)
∙ShowPersonnel(personnelSong_id, show_id, song_id, personnel_id)
NOTE: there are 4 additional tables: Album, Tour, Guest, & ShowGuests
What I'm aiming for is a list that will contain one row for every song performed. In my database, I've entered 90 songs over 4 shows so the resulted table should have 90 rows. This SQL statement gets me everything I want except for the Personnel/ShowPersonnel info:
select Date, name1 as [Venue], City, State, songnumber as [Location in Set], s_name as [Song], isSegue as [Segues], isSetBreak as [Set Break], isCloser as [Closer], isEncore1 as [Encore 1], isEncore2 as [Encore 2], songDesc as [Description]
from showsongs, show, song, venue
where showsongs.show_id=show.show_id
and showsongs.song_id=song.song_id
and show.venue_id=venue.venue_id;
FYI, personnel is any guest who plays during the show. now, I basically want two extra columns appended to this list. Ever cell in these two new columns should be blank except for the the song in which the person guested. So far, everything I have tried has resulted in only displaying the one record where the person guested. Like this one:
select Date, name1 as [Venue], City, State, songnumber as [Location in Set], s_name as [Song], isSegue as [Segues], isSetBreak as [Set Break], isCloser as [Closer], isEncore1 as [Encore 1], isEncore2 as [Encore 2], songDesc as [Description], p_name as [Personnel], p_instrument1 as [Instrument]
from showsongs, show, song, venue, showPersonnel, Personnel
where showsongs.show_id=show.show_id
and showsongs.song_id=song.song_id
and show.venue_id=venue.venue_id
and showpersonnel.personnel_id=personnel.person_id
and showpersonnel.song_id=showsongs.song_id;
Where am i going wrong?