Now for a challenge, use what you have learnt to answer the following question.
When was Kevin Bacon born?
Complete the Cypher query to find the year that Kevin Bacon was born. This value is stored in the born property.
Replace the ?????
with the correct Cypher to find the year Kevin Bacon
was born
.
MATCH (p:Person {name: "?????"})
RETURN p.?????
Select the correct year:
-
❏ 1954
-
✓ 1958
-
❏ 1962
-
❏ 1966
Hint
You need to filter the (:Person)
node with the name property of Kevin Bacon
. The property you are looking for is the born
property of the (:Person)
node.
Solution
To find the answer, run the following query:
MATCH (p:Person {name: "Kevin Bacon"})
RETURN p.born
This query will return 1958
, the born
property of the (:Person)
node with the name
property of Kevin Bacon
.
Summary
In this challenge, you demonstrated your skills to retrieve and filter nodes.
In the next lesson, you will learn how to traverse patterns in the graph with your queries.