Home »
MCQs »
Neo4j MCQs
Which of the following is the correct syntax to create a relationship?
32. Which of the following is the correct syntax to create a relationship?
- CREATE (node1)-(:RelationshipType)->(node2)
- CREATE (node1)-([:RelationshipType])->(node2)
- CREATE (node1)-(:RelationshipType);>(node2)
- CREATE (node1)-[:RelationshipType]->(node2)
Answer: D) CREATE (node1)-[:RelationshipType]->(node2)
Explanation:
CREATE (node1)-[:RelationshipType]->(node2), is the correct syntax.