The next step, another challenge, this time involving genre.
So we're finding the average rating for each of the genres.
I think we only have three genres in the data I gave you, but it should work for all of the genres.
So you'll need to join together information from the shows table or the series table that contains genre
along with the ratings table.
And then you'll need to group by genre most likely, and then do some operation to find the average
rating.
So I think I gave too much away.
Let's go ahead and do it.
So I know that we want to let's do a select start from series just to begin with.
So does this go away?
Oh, I see some weird glitch.
Okay, we want to work with genre, but first we need to get genre alongside the corresponding ratings
for each show so that we can then average the ratings by genre.
So we'll do a join.
We'll do something like select star from series join and then reviews on.
And then the same thing we've done before.
Series ID is equal to reviews, series ID that should give us everything, all the columns way more
than we need.
Now.
What we want to do is only work with genre and rating, so let's slim that down genre and reading.
We put them side by side.
Okay, now we just need to come in with a group by which we've done many times before, group by genre,
and then we'll calculate the average rating, so group by genre.
And then instead of rating, we'll do average rating.
Run this one.
And there we go, animation, comedy and drama.
Now, we could rename average, as I think it was average rating is what I showed here.
AVG rating either one one and then we could round it, which I did not in this example, but we've seen
how to do before.
So why not round average rating to two places?
Like that.
Copy and paste, and that looks good.
786816804.
And that's it for this challenge.
Next up, You guessed it.
We've got another one.