Introduction to Neo4j

Course: Introduction to Neo4j — Exercises neo4j icon


Welcome to Browser Guides! This is the interface for performing exercises to this Neo4j course. They are presented in the form of self-paced exercises. Navigate through the exercises by pressing the forward button at the right of the window, or by selecting the dot representing a page in the guide at the bottom of the page.

We start by walking you through some preparations and instructions. If you have used Neo4j Browser Guides before, you can skip to the last page.

This Browser Guide is published by Neo4j per this License for Use.

Before you start


Ensure the database is started

If you are using Neo4j Desktop, ensure that the project you have selected for use with Neo4j Browser is connected to a database that is started.

If you are using a Neo4j Sandbox or Neo4j Aura, the Neo4j Browser is already connected to a started database.

Enable multi-statement query editor

  1. Click the Browser Settings button in the lower left side of Neo4j Browser browser settings button.

  2. Make sure that the Enable multi statement query editor checkbox is selected: enable multi statement query editor

Pin a window

It is useful to pin the Browser Guide to the top, so that it doesn’t scroll down when you execute statements. You do this by pressing the pin button in the upper right corner of the page: pin button Pressing it once more will unpin the window again: unpin button.

About the exercises


Preparations before each exercise

Each exercise starts with a Preparations page. It shows you how to reset the database to the point it must be at to begin the exercise. This is useful, for example, if you have made a mistake in one of the previous exercises, or if you have done some testing on your own that changes the database into something that does not match the instructions in the exercises.

Writing and executing queries

  1. Write the query in the query pane at the top of Neo4j Browser.

  2. Click the Run button run button in order to execute the code.

Using code blocks

Many of the exercises contain code blocks with runnable code. Follow these steps in order to run the code against your database:

  1. Click inside of the code block. You will notice that the code is copied into the code pane at the top of Neo4j Browser.

  2. Click the Run button run button in order to execute the code.

"Taking it further"

Some exercises include optional sections called Taking it further. These are extra exercises that you can complete if you have more time.

Exercises:


Exercise 1 —  Retrieving nodes

Exercise 11 — Deleting nodes and relationships

Exercise 2 —  Filtering queries using property values

Exercise 12 — Merging data in the graph

Exercise 3 —  Filtering queries using relationships

Exercise 13 — Defining constraints on your data

Exercise 4 —  Filtering queries using the WHERE clause

Exercise 14 — Creating indexes

Exercise 5 —  Working with patterns in queries

Exercise 15 — Using query best practices

Exercise 6 —  Working with Cypher data

Exercise 16 — Using LOAD CSV for import

Exercise 7 —  Controlling query processing

Exercise 17 — Using APOC for importing data

Exercise 8 —  Controlling results returned

Exercise 18 — Use the neo4j-admin tool to import the CSV file

Exercise 9 —  Creating nodes

Exercise 19 — Importing data from an RDBMS using an application

Exercise 10 — Creating relationships