Skip to content

Instantly share code, notes, and snippets.

@amencarini
Last active August 29, 2015 14:02
Show Gist options
  • Save amencarini/f3cbe987803eea12cce5 to your computer and use it in GitHub Desktop.
Save amencarini/f3cbe987803eea12cce5 to your computer and use it in GitHub Desktop.
Neo4j World Cup: Average goals per match in all World Cups
match (wc:WorldCup)-->(m:Match)
optional match (m)<--()-[:SCORED_GOAL]->(g:Goal)
return wc.name, (count(distinct g) * 1.0 / count(distinct m)) as average
order by wc.name desc
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment