Free Sample Databases for Practice, and Where to Find Them
Practising on your own tiny tables is great at first. After a while, you want something bigger with realistic relationships. Several free sample databases exist for exactly this. This page describes the well-known ones; we do not host downloads ourselves, so get them from their official project pages.
Why use a sample database
- It already has several linked tables, so you can practise joins.
- It has enough rows that GROUP BY, ORDER BY and LIMIT feel meaningful.
- Many tutorials and exercises use the same samples, so you can compare answers.
Well-known samples
Chinook
A sample that models a digital music store: artists, albums, tracks, customers, invoices and employees. It is published as an open-source project with versions for SQLite, PostgreSQL, MySQL, SQL Server and others. The SQLite version is a single file, which makes it ideal for beginners.
Good for: joins across several tables, aggregates such as sales per country, and simple reports.
Sakila
A sample from the MySQL project that models a DVD rental shop: films, actors, customers, rentals and payments. It is described in the MySQL documentation and installed with two SQL scripts, one for the schema and one for the data. Community ports exist for PostgreSQL, often under the name Pagila.
Good for: many-to-many relationships (films and actors), dates and rentals, practising with a MySQL server.
Northwind
A long-standing sample originally from Microsoft that models a small trading company: products, suppliers, orders and customers. Scripts for SQL Server are published by Microsoft, and community versions exist for other databases.
Good for: classic order and order-line structures, business-style reports.
Comparing them
| Sample | Theme | Easiest way to start |
|---|---|---|
| Chinook | Music store | SQLite file |
| Sakila | DVD rental | MySQL scripts |
| Northwind | Trading company | SQL Server scripts or community ports |
Loading a sample
For a SQLite file, open it directly:
sqlite3 chinook.db
Then type .tables to see what is inside.
For SQL scripts on a server database, create an empty database and run the scripts in the order the project describes, for example with psql -f schema.sql or mysql < schema.sql.
Practice questions to try
- List every table and guess what each one stores before looking at its columns.
- Find the five customers with the most invoices or rentals.
- Count items per category or genre.
- Find records with no match in a related table, using LEFT JOIN.
A word of care
Download samples only from their official project or documentation pages. Check the licence on each project; most are free for learning. And remember these are practice data: the names and addresses are made up, and you should never load real personal data into practice projects.
A free learning page for beginners. Practise on a test database, never on real customer data, and check the official documentation for your database version.
This page is a free outline. No downloadable files, paid content, courses or certificates are offered on this site.