CQL Query Language -- Neo4j

This document is summarized based on the introdcution of Neo4j in W3Cschool

Neo4j CQL common order/clause:

  1. ###CREATE

    1.1 Used to create non-attar node; create a non-statistic node

    Grammar: CREATE (<node-name:)

    : node name to create

    : node tag name

    1.2 Used to create attractive node

    Grammar: CREATE(

    :

    ​ {

    :

    ​ ……

    :

    ​ }

    )

    Attr is a key-value pair.

    1.3 Used to create one label for node

    Used to create multiple labels for node

    Grammar: CREATE (::……:)

    Used to create one label for relation

    Grammar: CREATE(:)-[(:)]—>(:)

  2. MATCH

    Used to achieve data related to nodes and attrs;

    Used to achieve data related to nodes, relations and attrs.

    Grammar: MATCH(

    :

    )

  3. RETURN

    Used to retrieve some attrs of node;

    Used to retrieve all attrs of node;

    Used to retrieve some attrs of node and relations;

    Used to retrieve all attrs of node and relations

    Grammar: RETURN

    .,

    ​ …….

    .

    Concat ‘Match’ and ‘Return’ to retrieve

    E.G. MATCH(dept: Dept)

    ​ RETURN dept.deptno, dept.dname

  4. WHERE

  5. DELETE

  6. REMOVE

  7. ORDER BY

  8. SET

RELATION

Unilateralism

Bilateralism