You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
/SOLUTION 5/
SELECT bands.name AS "band name"
FROM bands
LEFT JOIN albums
ON bands.id=albums.band_id
GROUP BY bands.name
HAVING COUNT(albums.id)=0;
/including bands.name in group by is important as it is in result/
The text was updated successfully, but these errors were encountered:
Yes, that works because in the exercise band names are unique. In a different scenario where you have multiple bands with the same name, the GROUP BY should be using the band's unique IDs ( GROUP BY bands.id )
/SOLUTION 5/
SELECT bands.name AS "band name"
FROM bands
LEFT JOIN albums
ON bands.id=albums.band_id
GROUP BY bands.name
HAVING COUNT(albums.id)=0;
/including bands.name in group by is important as it is in result/
The text was updated successfully, but these errors were encountered: