Range Query

Find People Born in the Fifties

Using the sandbox on the right, write and execute a query to return people born in the 1950’s (1950 - 1959) that are both Actors and Directors.

How many Person nodes are returned?

  • ✓ 80

Hint

Use p.born.year to test the year for the Person node.

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
MATCH (p:Person)
WHERE p:Actor AND p:Director
AND  1950 <= p.born.year < 1960
RETURN p.name, labels(p), p.born

How many rows does it return?

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

Summary

In this challenge, you wrote and executed a basic query that tests ranges of values.

In the next challenge, you will answer another question.