Skip to content
Related Articles

Related Articles

Neo4j Query Cypher Language

Improve Article
Save Article
Like Article
  • Last Updated : 03 Aug, 2021

The Neo4j has its own query language that called Cypher Language. It is similar to SQL, remember one 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 then in a table format. 

Example: The Neo4j Cypher statement compare to SQL 

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

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 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. 



  • In the Neo4j the nodes are represented by “( )”.
  • The relationship is represented by ” -> “.
  • What kind of relationship is between the nodes are represented by ” [ ] ” like [:GeeksforGeeks]

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

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

  • Neo4j deals with nodes and the nodes contains labels that could be “Person”, “Employee”, “Employer” anything that can define the type of value field.
  • Neo4j also have properties like “name”, “employee_id”, “phone_number”, basically that will gives us information about the nodes.
  • Neo4j’s relationship also can contain the properties but this is not mandatory.
  • In Neo4j the relationship is like the kind of situation like X works for GeeksforGeeks here the X and the “GeeksforGeeks” is the node and the relation is works for, in Cypher language it will be like.

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

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


My Personal Notes arrow_drop_up
Recommended Articles
Page :

Start Your Coding Journey Now!