# Queries

```
// Return all Gellers

match(b {lastname:"Geller"} ) return b

// get all the students who are taking "Applied DB" course

MATCH (m:Student)-[:TAKING]->(k:Course{name:"Applied DB"}) return m,k

// get all courses taught by Ganesh

MATCH (m:Faculty{firstname:"Ganesh"})-[:TEACHING]->(k) return m,k


// get all students of Ganesh

MATCH (m:Faculty{firstname:"Ganesh"})-[:TEACHING]->(k:Course)<-[r1:TAKING]-(l:Student) return m,k,l



// Get all the faculty who are teaching Web Programming

MATCH (c:Course{name:"Web Programming"})<-[:TEACHING]-(f) return f


// Get all the faculty and students who are learning Web Programming

MATCH (c:Course{name:"Web Programming"})<-[:TEACHING]-(f), (c)<-[:TAKING]-(s:Student) return f,s



// returning LIST of values

MATCH (c:Course{name:"Web Programming"})<-[:TEACHING]-(f), (c)<-[:TAKING]-(s:Student) return collect(f.firstname)


MATCH (c:Course{name:"Web Programming"})<-[:TEACHING]-(f), (c)<-[:TAKING]-(s:Student) return collect(distinct f.firstname)
```
