I have the following tables in the database:
bands
- band_id
- band_name
albums
- album_id
- album_name
- album_owner
songs
- song_id
- song_name
- song_owner
ratings
- rating_id
- rating_value
- rating_song
Tables albums and songs relate to band_id from table bands by album_owner and song_owner.
Table ratings relates to song_id from table songs by rating_song.
Given the tables above how can I get all the bands and the count of albums, song and rating for each one? The ratings must be returned as the sum of rating_value divided by the number of rates.