SQL Writing Queries 9/23


#1

I can't for the life of me figure out what i'm messing up on here. on 9/23, writing queries.

TASK:
Return 10 movies with an IMDb rating greater than 6, are comedies, were made after 1995, and sorted by IMDb rating from highest to lowest.

(Hint: you can use AND more than once in a statement)

So I write my code as:

SELECT * FROM movies
WHERE genre = comedy
and imdb_rating > 6
AND year > 1995
ORDER BY imdb_rating DESC
LIMIT 10;

but it just sits there and spins...

i've got the semicolon, as far as my knowledge goes, my syntax is right.

any idea why it's not working?


#2

If I tell you that genre is a string, is that enough of a hint?


#3

it's enough to make me cry that I missed such a simple thing...ugh...thanks chicken kicker...(if that's a fable reference.)


#4

I don't know what you are referring to, but you're welcome :smile:


#5

I have no issues with the code itself (in that there are no errors) but it won't display the movies on the screen! Help?


#6

SELECT * FROM movies
WHERE genre = 'comedy'
AND year > 1995
AND imdb_rating > 6
ORDER BY imdb_rating DESC
LIMIT 10;