Welcome to the Treehouse Community

Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.

Start your free trial

Databases

Josh Keenan
Josh Keenan
20,315 Points

Can someone explain what this challenge wants?

https://teamtreehouse.com/library/reporting-with-sql/aggregate-and-numeric-functions/summing-values

I am British and English is my first language, however the query that gets the output which is the total of all ratings is not the right output as a where clause is needed, if someone could help me out with this I would really appreciate this.

select sum(rating) as starman_total_ratings from reviews;

Here's the code

1 Answer

Steven Parker
Steven Parker
231,128 Points

There's a hint when the instructions say "The movie "Starman" has the id of 6." and "Movie ids are found in the movie_id column in the reviews table."

But it what they really want might not be totally clear when they say "Write a query that totals up all ratings in the reviews table."

Perhaps the instructions should be: "Write a query that totals up all ratings for the movie "Starman" in the reviews table." Try combining that with the previous 2 hints and see if you get it.

Josh Keenan
Josh Keenan
20,315 Points

Yeah I had to refresh the page, I tried at least 6 solutions with one doing it for starman first but it failed, I refreshed the page and it worked, maybe I typoed