Professional Documents
Culture Documents
Slip 14
Slip 14
Node : Section
create(:Section{Name:"Sofa"})
create(:Section{Name:"Cupboard"})
create(:Section{Name:"Bed"})
create(:Section{Name:"Table"})
Node : Furniture
create(:Furniture{Name:"Sofa Cumbed"})
create(:Furniture{Name:"Bed with storage"})
create(:Furniture{Name:"Dinning table"})
create(:Furniture{Name:"Tea table"})
create(:Furniture{Name:"Seel Cupboard"})
create(:Furniture{Name:"L-shaped Sofa"})
Node : Staff
create(:Staff{Name:"Mr.Jay"})
create(:Staff{Name:"Mrs.Neha"})
create(:Staff{Name:"Mr.Satish"})
Node : Customer
create(:Customer{Name:"Riya"})
create(:Customer{Name:"Siya"})
create(:Customer{Name:"Abhi"})
create(:Customer{Name:"Gita"})
create(:Customer{Name:"Ram"})
Relation : belong to
match(ss:Section),(f:Furniture)
where ss.Name="Sofa" and f.Name="L-shaped Sofa"
create (f)-[:belong_to{ftype:"Moving"}]->(ss)
return f,ss
match(ss:Section),(f:Furniture)
where ss.Name="Sofa" and f.Name="Sofa Cumbed"
create (f)-[:belong_to{ftype:"Moving"}]->(ss)
return f,ss
match(ss:Section),(f:Furniture)
where ss.Name="Table" and f.Name="Tea table"
create (f)-[:belong_to{ftype:"Moving"}]->(ss)
return f,ss
match(ss:Section),(f:Furniture)
where ss.Name="Table" and f.Name="Dinning table"
create (f)-[:belong_to{ftype:"Moving"}]->(ss)
return f,ss
match(ss:Section),(f:Furniture)
where ss.Name="Cupboard" and f.Name="Seel Cupboard"
create (f)-[:belong_to{ftype:"Non Moving"}]->(ss)
return f,ss
match(ss:Section),(f:Furniture)
where ss.Name="Bed" and f.Name="Bed with storage"
create (f)-[:belong_to{ftype:"Non Moving"}]->(ss)
return f,ss
Relationship : handle by
match(ss:Section),(s:Staff)
where ss.Name="Table" and s.Name="Mr.Satish"
create (ss)-[:handle_by]->(s)
return ss,s
match(ss:Section),(s:Staff)
where ss.Name="Table" and s.Name="Mrs.Neha"
create (ss)-[:handle_by]->(s)
return ss,s
match(ss:Section),(s:Staff)
where ss.Name="Bed" and s.Name="Mr.Satish"
create (ss)-[:handle_by]->(s)
return ss,s
match(ss:Section),(s:Staff)
where ss.Name="Cupboard" and s.Name="Mr.Jay"
create (ss)-[:handle_by]->(s)
return ss,s
match(ss:Section),(s:Staff)
where ss.Name="Sofa" and s.Name="Mr.Jay"
create (ss)-[:handle_by]->(s)
return ss,s
Relationship : purchase by
match(ss:Section),(c:Customer)
where ss.Name="Sofa" and c.Name="Abhi"
create (ss)-[:purchase_by]->(c)
return ss,c
match(ss:Section),(c:Customer)
where ss.Name="Table" and c.Name="Gita"
create (ss)-[:purchase_by]->(c)
return ss,c
Relationship : enquire by
match(ss:Section),(c:Customer)
where ss.Name="Table" and c.Name="Siya"
create (ss)-[:enquire_by]->(c)
return ss,c
match(ss:Section),(c:Customer)
where ss.Name="Cupboard" and c.Name="Ram"
create (ss)-[:enquire_by]->(c)
return ss,c
match(ss:Section),(c:Customer)
where ss.Name="Bed" and c.Name="Riya"
create (ss)-[:enquire_by]->(c)
return ss,c
QUIRIES :
OR
Query:
match(f:Furniture) return f.Name
f.Name
Sofa Cumbed
Bed with storage
Dinning table
Tea table
Seel Cupboard
L-shaped Sofa
c)List the names of customers who have done only enquiry but not made any purchase.
Query:
match(ss:Section),(c:Customer) where(ss)-[:enquire_by]->(c) and not(ss)-
[:purchase_by]->(c) return DISTINCT c.Name
OUTPUT :
c.Name
Ram
Riya
Siya