Graph query languages let you ask questions by drawing the shape of the answer. Today you'll learn Cypher's declarative, pattern-matching approach: how to describe nodes and relationships as ASCII-art patterns, filter with WHERE, traverse multiple hops, aggregate results, and write data with CREATE and MERGE — and why this reads so differently from SQL joins.
Cypher is the declarative query language for property graphs, originally created for Neo4j and now standardized as the basis of GQL (ISO/IEC 39075). Instead of describing how to fetch data step by step, you describe the shape of the pattern you want and let the engine find every place it occurs.
We'll use this small social-and-work graph throughout the lesson:
A relational query says join these tables on these keys. A Cypher query instead draws the relationship you're after:
MATCH (a:Person)-[:WORKS_AT]->(c:Company)
RETURN a.name, c.name
You never wrote a join condition. The arrow is the join, and the engine resolves it by following stored relationships.
:Person groups nodes of the same kind.:WORKS_AT names the kind of edge.{name: "Alice"}, {since: 2021}.Cypher is case-sensitive for labels, types, and property keys, and keywords are conventionally written in uppercase.