Hi,

I am new to Neo4j and Cypher. I want to write a query for getting following 
information:

*Graph Description:* Sample graph schema image is attached in this post 
with properties of each node. Graph contains Professor nodes (labeled with 
P) and student nodes (labeled with S). Professor nodes are connected to 
their student nodes with edge having 'student' label. All students of same 
professor form a *group*.

Professor nodes properties:

   - name

Student nodes properties:

   - name


   - grade

*Query:* I want to find professors and their students who have grade 
greater than average grade of their *group*.

*Example:*

Students' grades avg. for professor P1 group = (7.0+8.0)/2 = 7.5  
S2 has grade greater than 7.5.
   
Students' grades avg. for professor P2 group = (4.0+8.0+9.0)/3 = 7.0
S4 and S5 have grade greater than 7.0.

Final output should be like this:

P1, S2, 8.0
P2, S4, 8.0
P2, S5, 9.0

<https://lh3.googleusercontent.com/-QhdOqT8h02k/V77QBM6OT9I/AAAAAAAAAJc/goPZCCjMZ9w5pCMG6QOGc81kT1uTOhGCACLcB/s1600/Diagram1.png>

-- 
You received this message because you are subscribed to the Google Groups 
"Neo4j" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to neo4j+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to