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

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
229,980 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.