OneCompiler

N4j

140

create (:Employee {name: "Pratik" , qualification: ["Bsc","Msc"]})

create(:department {name: "Computer"})

create(:skillset {skills:["Developer","Tester"]})

Relation

Match(e:Employee),(d:department)Where e.name="Pratik" and d.name="Computer" Create(e)-[:work]->(d) return e,d

#list skillsets from emp

Match(e:Employee),(s:skillset) Where e.name = "Pratik" and (e)-[:acquired]->(s) return s

#list the names of employees in department

Match(e:Employee),(d:department) Where d.name = "Computer" and (e)-[:works_in]->(d) return e

#List the department along with the count of employee init

Match (d:department),(e:Employee) Where (e)-[:work]->(d) return count(e.name) as no_of_emp, d.name