Writing Queries #2


#1

I'm a bit stuck on number two, it asks :

"Return all of the unique years in the movies table sorted from oldest to newest."

But when I add the "ADD year ASC; it does not return anything, when I take it off then it returns all the movies from that year and genre. I don't think I am writing it out correctly, any ideas?

SELECT DISTINCT year, genre, name FROM movies
WHERE genre = 'drama'
AND year ASC;

Thank you!


#2

In your question you've written both:

ADD year ASC
AND year ASC

Think about what want to do there, ADD something? AND something?

How about sorting something? Have a look back at this exercise.


#3

Thanks, I used the ORDER BY and it worked. I was expecting the next query would be building on the previous, but what it looks like it means is that I'm writing individual queries.

Thanks again!


#4

I think that is the case in most of this section.