Youngest actor
Youngest actor in highest rated movie
This query finds the highest rates movies:
MATCH (m:Movie)
WHERE m.imdbRating IS NOT NULL
RETURN m.title, m.imdbRating
ORDER BY m.imdbRating DESCYour challenge is to find the youngest actor in the highest rated movie.
Modify this query to:
-
Match
MovietoPersonnodes using theACTED_INrelationship -
Add the
Personnode’snameandbornproperty to theRETURNclause -
Order the results by the
Personnode’sbornproperty
Who is the youngest actor that acted in the most highly-rated movie?
Enter the name (case-sensitive!):
-
✓ Scott Grimes
Hint
Use the MATCH pattern (m:Movie)←[ACTED_IN]-(p:Person)`.
Add the Person node’s born property to the ORDER BY clause.
Solution
The correct answer is: "Scott Grimes".
You can run the following query to see the result:
MATCH (m:Movie)<-[ACTED_IN]-(p:Person)
WHERE m.imdbRating IS NOT NULL
RETURN m.title, m.imdbRating, p.name, p.born
ORDER BY m.imdbRating DESC, p.born DESCSummary
In this challenge, you wrote a query to return results sorted by multiple values.
In the next lesson, you will learn limiting how much data is returned.