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:
Student nodes properties:
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