DataBrighten

    Sample databases for SQL practice

    13 practice databases, each as a ready-to-run script for SQLite, PostgreSQL, MySQL, SQL Server and DuckDB: 65 scripts in all, with six questions per database written in each dialect.

    Every database and engine

    How they were tested

    Each script was loaded with the engine's own command-line tool (sqlite3, psql, mysql and sqlcmd; DuckDB through its Python package) into an empty database, the row counts were checked, and all six questions were run. The tested versions were SQLite 3.37.2, PostgreSQL 15.18, MySQL 8.4.13, SQL Server 2022 16.0.4325.4 and DuckDB 1.5.6. A database is published only when all five engines return the same answers.

    The data is fictional: the same seed-42 tables as our sample datasets, so you can practise the same question in Excel, pandas and SQL and compare. Released under CC0.