Range Query

Find people who act and direct born in the 1950’s

Find people born in the 1950’s (1950 - 1959) that are both Actors and Directors.

Update the WHERE clause to test if a Person node has:

  1. Actor and Director labels.

  2. a born property with a year value in the range 1950 to 1959 inclusive.

cypher
MATCH (p:Person)
WHERE p:??????? AND p:???????
  AND ??????
RETURN p.name, labels(p), p.born

How many rows are returned?

  • ✓ 80

Hint

You can test for a label using WHERE p:Label.

The born property is a date and has day, month, and year values. You can test year using WHERE p.born.year.

Solution

The answer is 80

You can run the following query to see the result:

cypher
MATCH (p:Person)
WHERE p:Actor AND p:Director
  AND 1950 <= p.born.year < 1960
RETURN p.name, labels(p), p.born

Summary

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

In the next challenge, you will answer another question.