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.


Order "movies" with the release "year" ascending with the "title" in alphabetical order. challenge task 2 of 2 error

Can anyone tell me whats wrong with my code? I am getting error and I am not sure what is the mistake I am doing here. Below is the code I used:

SELECT * FROM movies ORDER BY year ASC, title ASC;

2 Answers

Sergey Podgornyy
Sergey Podgornyy
20,660 Points

try this code:

SELECT * FROM movies ORDER BY release_year ASC, title ASC;

Nope it is still giving this error. Your query is not ordering 'movies' by release 'year' and then by 'title'.

Steven Parker
Steven Parker
216,148 Points

Your original answer is correct, I don't know why it would not be scored properly unless you had a typo while entering it. I'm a big proponent of the KISS principle ("Keep It Simple, Student!"). And since ascending is the default sort order, I would just shorten it to:

SELECT * FROM movies ORDER BY year, title;

This isn't any more correct than what you had, but the less you type, the less likely you are to get a typo.