Welcome to the Treehouse Community
The Treehouse Community is a meeting place for developers, designers, and programmers of all backgrounds and skill levels to get support. Collaborate here on code errors or bugs that you need feedback on, or asking for an extra set of eyes on your latest project. Join thousands of Treehouse students and alumni in the community today. (Note: Only Treehouse students can comment or ask questions, but non-students are welcome to browse our conversations.)
Looking to learn something new?
Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and a supportive community. Start your free trial today.
I can't figure this out!
Question: Group all reviews by "movie_id" and get the average "score" and alias it as "average
My answer: SELECT movie_id AVG(score) AS average FROM movies GROUP BY movie_id
I think something like ...
SELECT AVG(score) AS average FROM reviews GROUP BY movie_id
... should do it.
Aah, I was quering the wrong database.
I think it would be helpful if we are told what schema (databases and tables) are available to us. Often times in this course, I had to guess the name of the database in the challenges. Most of the times, it carries over from one challenge to another, but sometimes I forget, and then its annoying cause its like throwing the basketball into the dark hoping to find a basket somewhere, if you know what I mean...
Thanks for your answer.