Open In App

Neo4j Query Cypher Language

The Neo4j has its own query language that called Cypher Language. It is similar to SQL, remember one thing Neo4j does not work with tables, row or columns it deals with nodes. It is more satisfied to see the data in a graph format rather than in a table format. 

Example: The Neo4j Cypher statement compare to SQL 



MATCH (G:Company { name:"GeeksforGeeks" })
RETURN G

This Cypher statement will return the “Company” node where the “name” property is GeeksforGeeks. Here the “G” works like a variable to holds the data that your Cypher query demands after that it will return. It will be more clear if you know the SQL. Below same query is written in SQL. 

SELECT * FROM Company WHERE name = "GeeksforGeeks";

The neo4j is made for NoSQL database but it is very effective on relational database too, it does not use the SQL language. 



ASCII-Art Syntax: The Neo4j used ASCII-Art to create pattern. 

(X)-[:GeeksforGeeks]->(Y)

So above description is helpful to decode the ASCII-Art Syntax given, (X)-[:GeeksforGeeks]->(Y). Here the X and Y are the nodes X to Y relation kind is “GeeksforGeeks”. 

Defining Data: Below points will help you to grasp the concept of Cypher language. 

 (X)-[:WORK]->(GeeksforGeeks).

Note: Here the Company is the node’s label, name is the property of the node 

MATCH (G:Company { name:"GeeksforGeeks" })
RETURN G 
Article Tags :