source: music/views/avg_price_per_artist.sql@ bfca48b

Last change on this file since bfca48b was bfca48b, checked in by ManuelTrajcev <manueltrajcev7@…>, 3 weeks ago

+4 views with controlers and templates

  • Property mode set to 100644
File size: 270 bytes
Line 
1CREATE VIEW avg_price_per_artist AS
2SELECT
3 ar.name,
4 COALESCE( ROUND(avg(t.unit_price), 2)::text, 'not enogu data') as avg_price_per_track
5FROM artist ar
6left join album a on ar.artist_id = a.artist_id
7left join track t on a.album_id = t.album_id
8group by ar.name
Note: See TracBrowser for help on using the repository browser.