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 trialMaggie Nasho
6,212 PointsCulculating the MInimum and the Maximum Values
Challenge Task 1 of 1
We're in a movie database. There's a reviews table with the columns of id, movie_id, username, review and rating.
The movie "Starman" has an id of 6. Movie ids are stored in the movie_id column. Calculate the minimum and maximum ratings for "Starman". Alias them as star_min and star_max.
Ashton Shingirirai Calton Munkondya
3,925 PointsSELECT MIN(ratings) AS star_min, MAX(ratings) AS star_max FROM views WHERE movie_id =6;
try this way
2 Answers
Karmen Philip
11,046 PointsSELECT MIN(rating) AS star_min, MAX(rating) AS star_max FROM reviews WHERE movie_id =6;
Ashton Shingirirai Calton Munkondya
3,925 PointsSELECT COUNT (movie_id), MIN(movie_id) AS star_min, MAX(movie_id) AS star_max FROM reviews GROUP BY movie_id ;
i am getting this bummer ; Your query didn't perform the correct minimum and maximum calculation.
Steven Parker
231,248 PointsDid you really intend this as an answer for Maggie, or did you mean to start a new question?
If you're going to start a new question be sure to include a link to the course page as well as your code. Usually this is done for you when you use the "Get Help" button.
Steven Parker
231,248 PointsSteven Parker
231,248 PointsIt doesn't look like you've written any code yet.
At least please give it a good-faith attempt and then ask for help if you have trouble, and be sure to show your code and provide a link to the course page you are working with.
If you're totally lost, you may want to review one or more of the videos.