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 DESC
Your challenge is to find the youngest actor in the highest rated movie.
Modify this query to:
-
Match
Movie
toPerson
nodes using theACTED_IN
relationship -
Add the
Person
node’sname
andborn
property to theRETURN
clause -
Order the results by the
Person
node’sborn
property
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 DESC
Summary
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.