Female or Male number filtering

I am trying to filter females' and male relationships and get a table for both relations and find how many males and females are there? But My code is not helping me out to solve it> Any suggestions, I try with UNION ALL as well, didn't work for me :slight_smile: \

> MATCH (std:student{gender: 'M'})-[:major]->(dgr:degree) <-[:administer]-(dep:department)
> where dep:department='Computer Science'
> MATCH (std:student{gender: 'F'})-[:major]->(dgr:degree) <-[:administer]-(dep:department)
> where dep:department='Computer Science'
> RETURN count(std.gender) as males,count(std.gender) as females

Blockquote

Try this:

MATCH (std:student)-[:major]->(dgr:degree) <-[:administer]-(dep:department)
where dep:department='Computer Science'

with distinct std.gender as gender, count(distinct std) as cnt
return gender, cnt
2 Likes

Please put Limit 11 on number of rows returned so that server will not send all the data to client machine.

Thanking you
G Sameer