Limiting Results

Limiting results by movie rating

Lowest rated movie

Complete this query so that it returns just the lowest rated movie based on the imdbRating property

cypher
MATCH (m:Movie)
WHERE m.imdbRating IS NOT NULL
RETURN m.title, m.imdbRating
/*select:ORDER BY m.imdbRating LIMIT 1*/
  • ORDER BY m.imdbRating LIMIT 1

  • ORDER BY m.imdbRating DESC LIMIT 1

  • LIMIT 1 ORDER BY m.imdbRating

  • LIMIT 1 ORDER BY m.imdbRating DESC

Hint

Ascending order is the default when using ORDER BY.

Data limits are set at the end of a Cypher statement.

Solution

The correct Cypher statement is :

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

Summary

In this challenge, you wrote a query to limit results so you could answer a question about the data.

In the next challenge, you will eliminate duplication in the results.