I am using the musicbrainz.org postgresql database, which I have installed locally and have accessed via python.
The database is a list of music artists and associated criteria. Here is the schema :
How can I create a SQL query that outputs all tracks for a release group? I am able to get the proper artist info and releases associated with a specific band but the tracks for the release are wrong using the below query's:
strsql_band = "SELECT artist.id, artist.gid, artist.name, artist.comment FROM artist WHERE artist.name=%s AND type>1 ORDER BY type, artist.last_updated DESC"
strsql_memberid = "SELECT entity0, link.begin_date_year, link.end_date_year FROM l_artist_artist l JOIN link ON l.link=link.id WHERE entity1=%s AND link_type=103"
strsql_release = "SELECT id, release_group.name FROM release_group WHERE artist_credit=%s"
# This does not return the correct tracks for the release
strsql_track = "SELECT id, position, name, length FROM track WHERE artist_credit=%s LIMIT 15"
Any help would be greatly appreciated, I have been banging my head on this for hours now.