Complete the questions below to complete this module.
1. Terminology
What do we call data points in a Neo4j database?
-
❏ Entities
-
✓ Nodes
-
❏ Relationships
-
❏ Rows
Hint
A graph database consists of nodes and relationships.
Solution
The answer is Nodes
2. Terminology
What do we call the connections data points in a Neo4j database?
-
❏ Connections
-
❏ Joins
-
❏ Nodes
-
✓ Relationships
Hint
A graph database consists of nodes and relationships.
Solution
The answer is Relationships
3. Querying Graphs
What is the name of the language used to match patterns in a Neo4j database?
-
✓ Cypher
-
❏ GraphQL
-
❏ Neo4QL
-
❏ SQL
Hint
Neo4j has a proprietary query language optimised to explore highly connected datasets.
Solution
The answer is Cypher
4. Finding Movies
Which of the following options is a valid Cypher statement for finding movies in the Comedy genre?
-
❏
SELECT movie.Title FROM (Movie) WHERE (Movie)-→(Genre {name: 'Comedy'})
-
✓
MATCH (m:Movie)-[:IN_GENRE]→(g:Genre {name: "Comedy"}) RETURN m.title
-
❏
MATCH movie[IN_GENRE]Genre WHERE Genre.title = 'Comedy' RETURN movie[title]
-
❏
const movie, genre = (movie:Movie)-[:IN_GENRE]→(genre:Genre {name: "Comedy"}); print(movie.title)
Hint
Cypher uses the MATCH
clause to find patterns in data.
You draw patterns using brackets and arrows.
Solution
The following is a valid Cypher statement:
MATCH (m:Movie)-[:IN_GENRE]->(g:Genre {name: "Comedy"}) RETURN m.title
Summary
Great job!
In the next module, you will learn about Neo4j in the context of Generative AI.