Create a query that lists each genre name the number of show

Create a query that lists each genre name, the number of shows within that genre, and the total number of viewers for that genre. Your results must include all genres, even if they have no shows. Sort by the total number of viewers in descending order. HINT: This query returns 6 records

Solution

SELECT Genres.Genres, Count(Shows.Show) AS CountOfShow,

Sum(Shows.[# of Viewers] AS [SumOf# of Viewers])

FROM Genres FULL OUTER JOIN Shows on Genres.ID=Shows.Genres

GROUP BY Genres.Genres

ORDER BY Sum(Shows.[# of Viewers]) DESC;

Create a query that lists each genre name, the number of shows within that genre, and the total number of viewers for that genre. Your results must include all

Get Help Now

Submit a Take Down Notice

Tutor
Tutor: Dr Jack
Most rated tutor on our site