Querying with Cypher in Neo4j 4.x Improvement Suggestions

Hello again :)

After 2 years of experience with Neo4j for my business, I'm taking the time to do all the certifications. Doing so I can see some 'oops' in the graph academy courses and suggest some modifications.

Question 3
on Introduction to Cypher Chapter

I'm 99% sure about that, the answer is not 'When you want to use the node or relationship to return a value'. You MUST use a variable as soon as you have to use it later in the query part, who includes more than the RETURN clause.

QUestion 2 Answer doesn't respect Cypher Style Guidelines, I think.

Thank you for these courses, even after two years it makes things crystal clear.

Hello @tard_gabriel

You are absolutely correct about following Cypher Style Guidelines.

For Question 2 I changed the correct answer from:

(:Customer {customerName: 'ABCCO'})-[:BOUGHT]->(p:Product) RETURN p.productName
to
(p:Product)<-[:BOUGHT]-(:Customer {customerName: 'ABCCO'}) RETURN p.productName

With respect to Question 3, it is based upon what the student has learned thus far. I changed the question to:

Thus far, you have learned to use a simple MATCH clause to return values. When must you use a variable in a simple MATCH clause?

The students have not learned about using WHERE clauses or WITH at this point in the course.

Thanks for your feedback!

Elaine

Hello again @elaine_rosenber
Found another 'Oops'

Controlling the query chain -> Intermediate processing with WITH
Link here

I don't know if you can use the direct link would be easier for you.

MATCH (a:Person)-[:ACTED_IN]->(m:Movie)
RETURN a.name, count(a) AS numMovies, collect(m.title) as movies

count(a) AS numMovies ?
It should be count(m)

The result works in this case only because there is only one ACTED_IN relation per Person Movie pair if I'm not wrong.

Thanks @tard_gabriel. I have tweaked the code.

Elaine