Reputation: 19
This is what I need my query to do: For classification "Sophomore", list the classification (Sophomore) and the average GPA of students with that classification.
This is what I have:
MATCH (user)<-[:Student]-(Student)
WHERE user.Classification = "Sophomore"
RETURN user.GPA as Student
Upvotes: 1
Views: 59
Reputation: 8546
Looking at your schema it appears that you have all relevant properties (Classification and GPA) on the Student node label. If that's the case there's no need to traverse a relationship here. Try this query:
MATCH (s:Student) WHERE s.Classification = "Sophomore"
RETURN avg(s.GPA)
Upvotes: 1