20MIA1002 NoSQL Lab 11

You might also like

Download as docx, pdf, or txt
Download as docx, pdf, or txt
You are on page 1of 2

CSE3086 20MIA1002

LAB ASSIGNMENT – 11
create (p1:Person{name: "Micheal"}),(p2:Person{name: "Jennifer"}),
(p3:Company{name:"Neo4j"}),(p4:Technology {type:"Graphs"})

match (a:Person),(b:Person) where a.name="Micheal" and b.name = "Jennifer" create (b)-


[:IS_FRIENDS_WITH {since:2018}]->(a)

match (a:Technology),(b:Person) where a.type="Graphs" and b.name = "Jennifer" create (b)-


[:LIKES]->(a)

match (a:Company),(b:Person) where a.name="Neo4j" and b.name = "Jennifer" create (b)-


[:WORKS_FOR]->(a)

match (n) return n

Q2) Display the details of students who have registered NoSQL in c1 slot under
faculty “ABC”. Display the details of students who have registered NoSQL in
c2 slot under faculty “XYZ”. Design the appropriate graph to display the result
for the above queries. Make sure to use properties in nodes and relationships.

Q3) Load your own studentregno.csv file into a graph in neo4j.


LOAD CSV WITH HEADERS FROM "file:///student20mia1002.csv" AS line
CREATE (n:Node { latitude: toFloat(line.latitude), longitude: toFloat(line.longitude), rssi: lin
e.rssi })

MATCH (n:Node) RETURN n


Q4) Delete the relationship IS_FRIENDS_WITH between two-person labelled
nodes from question 1. Delete the node Neo4j company from question 1.
match (Person{name:"Jennifer"})-[r:IS_FRIENDS_WITH]->() delete r

match (n:Company{name:'Neo4j'}) detach delete n

You might also like