1. Home
  2. /
  3. Cypher
  4. /
  5. Basic Cypher Queries

Basic Cypher Queries - Cypher Typing CST Test

Loading…

Basic Cypher Queries — Cypher Code

Creating nodes and relationships, then querying them in Neo4j using Cypher.

CREATE (a:Person {name: "Alice"})
CREATE (b:Person {name: "Bob"})
CREATE (a)-[:FRIEND]->(b);

MATCH (p:Person)-[:FRIEND]->(f)
RETURN p.name, f.name;

Cypher Language Guide

Cypher is Neo4j’s declarative graph query language designed for creating, querying, and manipulating graph data structures. It uses ASCII-art-like pattern matching to express complex graph relationships intuitively.

Primary Use Cases

  • ▸Graph traversal and pathfinding
  • ▸Recommendation systems
  • ▸Social network analysis
  • ▸Fraud detection and link analysis
  • ▸Knowledge graphs and semantic search
  • ▸Network and IT infrastructure mapping

Notable Features

  • ▸Pattern-matching syntax for graph queries
  • ▸Variable-length path traversals
  • ▸Shortest-path algorithms
  • ▸Constraints and schema definitions
  • ▸Native graph manipulation (CREATE, MERGE)
  • ▸Integration with APOC graph procedures

Origin & Creator

Developed by Neo4j Inc. in 2011 as the primary query language for graph databases; later adopted under open standards via the openCypher project.

Industrial Note

Cypher dominates industries where relationships are more important than tabular rows: fraud graphs, financial link analysis, logistics routing, recommendation engines, social networks, cybersecurity threat graphs, and semantic knowledge graphs.

More Cypher Typing Exercises

Advanced Cypher FilteringNeo4j AggregationNeo4j Path MatchingNeo4j Create With PropertiesNeo4j Relationship PropertiesNeo4j Delete NodesNeo4j IndexesNeo4j ConstraintsNeo4j Full-Text Search

Practice Other Languages

CReactPythonC++RustTypeScriptKotlinPHPJavaC#RubyMqlCqlN1qlGremlin