How to get the studio albums for an artist

Tags: #<Tag:0x00007f4d56b39ca0>

I am trying to get sql query for getting an artist’s studio and live albums. The artist id is “0ab49580-c84f-44d4-875f-d83760ea2cfe” (Maroon 5). I do not wants demos or any other types. In essence I want to extract just the “Album” and “Album + Live” sections of

I believe I have found the right code here:

If I pass in Maroon 5’s artist id of 66179 (eg “WHERE rg.artist_credit=66179”) I get all of their albums (I think). But how do I then determine if it is studio album, live, demo, EP, single, etc? Maybe I have the incorrect sql code. It has been quite sometime from whence I have read perl.


Artist ID is not the same as Artist Credit ID. For example, your request doesn’t return albums credited to Maroon 5 with featuring artists.

It might be easier to use the web service instead. Maroon’s 5 albums can be retrieved every album from with their primary and secondary types so that it can be filtered afterwards.

If you still need to make direct SQL queries, take a look at *_type tables in the database schema.