Ordering Results

imdb ratings

Movies with ratings

Find and return movie titles ordered by the the imdbRating value.

Update this query to:

  1. Return only movies that have a value for the imdbRating property.

  2. Order the results by the imdbRating value (highest to lowest).

cypher
MATCH (m:Movie)
WHERE m.imdbRating ?? ??? ???
RETURN m.title, m.imdbRating
ORDER BY ?????? ????

What is the highest imdbRating value for a movie?

  • ✓ 9.6

Hint

You test a property exists using the IS NOT NULL clause.

If you order the results in descending order, the top result will be the highest rating.

Solution

The answer is 9.6.

You can run the following query to see the result:

cypher
MATCH (m:Movie)
WHERE m.imdbRating IS NOT NULL
RETURN m.title, m.imdbRating
ORDER BY m.imdbRating DESC

Summary

In this challenge, you executed the query and answered a question about the data returned.

In the next challenge, you will write a query to return ordered results.