Counting Results

Counting results

Most active director?

Using count() write a query to return the number of movies a person directed.

What is the highest number of movies a director directed in our graph?

  • ✓ 42

Hint

You will need to order the count results so you can determine the highest count.

Solution

You can run the following query to find the answer:

cypher
MATCH (d:Director)-[:DIRECTED]-(m)
RETURN d.name AS Director,
count(*) AS numMovies
ORDER BY numMovies DESC LIMIT 5

What number is the highest for a director?

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

Summary

In this challenge, you wrote a query to aggregate results so you could answer a question about the data.

In the next challenge, you will write a query to create lists.

Chatbot

Hi, I am an Educational Learning Assistant for Intelligent Network Exploration. You can call me E.L.A.I.N.E.

How can I help you today?