Highest for Tom Hanks

Using WITH to scope variables

Using the query you just created, answer this question:

What is the highest revenue for a movie for Tom Hanks?

What is the highest revenue? (enter an integer number without commas)

  • ✓ 1066969703

Hint

You should look at the results returned from the last query:

cypher
WITH  'Tom Hanks' AS theActor
MATCH (p:Person)-[:ACTED_IN]->(m:Movie)
WHERE p.name = theActor
AND m.revenue IS NOT NULL
WITH m ORDER BY m.revenue DESC LIMIT 1
RETURN m.revenue AS revenue, m.title AS title

What is the revenue? (no commas or decimal points)

Once you have entered the answer, click the Try Again button below to continue.

Solution

You can run the following query to find the answer:

cypher
WITH  'Tom Hanks' AS theActor
MATCH (p:Person)-[:ACTED_IN]->(m:Movie)
WHERE p.name = theActor
AND m.revenue IS NOT NULL
WITH m ORDER BY m.revenue DESC LIMIT 1
RETURN m.revenue AS revenue, m.title AS title

What is the revenue? (no commas or decimal points)

Once you have entered the answer, click the Try Again button below to continue.

Summary

In this challenge, you answered another question from the graph.

In the next challenge, you write a query to return a subset of data using map projection.