Cypher is a declarative query language for graphs, based on graph pattern syntax (ascii-art). It focuses on readability, composability, and efficient syntax.
SQL is the declarative query language for relational databases (“relational” in this instance doesn't mean “relationships”) that has been used since the 1970s. It also allows less-technical users to interact with databases. Originally intended for single table operations on form data, joins were added later. It has been evolving ever since, with support for geo, json, xml, analytics, etc.
Some of the differences between Cypher and SQL include:
|
Cypher
|
SQL
|
| RETURN |
SELECT |
| MATCH |
FROM...JOIN ON... |
| WHERE, ORDER BY, LIMIT, SKIP are the same |
| Automatic grouping |
GROUP BY |
| Query pipelining with WITH no need for HAVING |
HAVING |
| Both have support for (user defined) procedure and function calls |
| COLLECT and UNWIND to aggregate and expand lists of data |
|
| No window functions |
|
| Subqueries via CALL {} syntax |
FROM() |
| Data loading with LOAD CSV |
|
| Batching via CALL {} IN TRANSACTIONS |
|
| Variable path length pattern syntax |
Recursive common table expressions (CTEs) |
Learn more about their differences.