Databases
Slides and lecture notes
There are brand new teaching materials for this course in 2026/27. The version now on this web page (last updated 2026-11-01) is complete.
- Lecture notes
- Exercises for supervisions (same as those embedded in the lecture notes)
- Slides without step-by-step builds
- Slides with step-by-step builds
SQL database practicals
It is important that you try out queries on a real database so that you can get a feel for how it works. We provide you with an example database of movies that is also used as running example in the lectures. For the SQL exercises we will use DuckDB. There are two options for running DuckDB:
- Install the DuckDB command line interface
on your computer, download the example database, and then open that
database by running
duckdb movies.duckdb - Use DuckDB in your browser, where the movies database is already preloaded
Feel free to modify the database as you like; your changes will not be saved and nobody else will be affected. If you break the database, you can just re-download it.
Document database practicals
For the document databases exercises we also use DuckDB, but this time with a different schema that uses DuckDB's JSON datatypes. Like with the SQL practicals, there are two options:
- Install the DuckDB command line interface
on your computer, download the example database, and then
open that database by running
duckdb movies-json.duckdb - Use DuckDB in your browser, where the movies-json database is already preloaded
Graph database practicals
As graph database we use Traverse, an embedded database that supports the Cypher query language. There are two options for running it:
Use Traverse in your browser. This option is recommended because it comes with a graphical visualisation that the command-line tool does not. Follow these steps:
- Open Traverse in your browser.
- Delete the preloaded database (which is also about movies, but has a different schema from that in the lecture notes). Click the cylinder icon in the left sidebar, then click the red “Delete” button at the bottom of the screen, and confirm that you want to delete the data.
- Download movies.tvdb to your computer.
- Click the folder icon in the left sidebar, then “Upload .tvdb”, and upload the file you just downloaded. Now you should be able to run queries.
- Alternatively, there is a simple command-line tool you can run on your computer. Go to github.com/ept/cypher-shell and follow the instructions for installation there. You will also need to download movies.tvdb to your computer.
Datalog practicals
For the Datalog exercises we use Soufflé, a Datalog implementation. There are two options for running it:
- Use Soufflé in your browser, where the movies database is already preloaded. This option is recommended, since installing Soufflé on your own computer can be a bit fiddly.
Install Soufflé on your computer, download movies-souffle.zip, and unzip it. It contains the schema (
movies-schema.dl), the facts (in a subdirectoryfacts), and an example program. In that directory, runsouffle -F facts -D- example.dlto run the example. To write your own program, save it in the same directory, start it with the line
#include "movies-schema.dl"(which the browser version does not need), and run it in the same way.