Connect any database. Ask in plain English.

Try free
← Blog

Sample Databases for SQL Practice: 13 Free Ones Compared, With Row Counts From 847 to 103 Million (2026)

Northwind, Sakila, Pagila, Chinook, AdventureWorks, WideWorldImporters, the MySQL employees and world databases, TPC-H, TPC-DS, IMDb and Stack Overflow: where to get each, its licence, and the tables, rows and dates we counted in twelve of them on 3 December 2026. Their biggest tables run from 847 rows to 103 million, and five of the official install routes have a trap we hit, with the fix.

Fastero Dev TeamFastero Dev Team2026-12-03

On 3 December 2026 we downloaded nine classic sample databases from their official or canonical GitHub repositories and loaded eight: into SQL Server 2025, MySQL 8.4.13 and PostgreSQL 18.7 in Docker, and into SQLite 3.50.4 and DuckDB 2.0.1 from Python 3.14. The ninth, WideWorldImporters, would have reserved over 3 GB of disk, so we read its export file instead. We counted every table and row, read the first and last date in each and ran a practice query on each one we loaded. DuckDB generated TPC-H and TPC-DS, and we counted IMDb's seven files by streaming them.

The short answer: for first joins, use Chinook (11 tables, a 1 MB SQLite file) or Northwind (13 tables, 2,155 order lines). For a schema that feels like a company, restore AdventureWorks2025 to SQL Server: a 48 MB backup, 71 tables in 6 schemas, 121,317 order lines from 2022 to 2025. For window functions on volume, load the MySQL employees database (2.8 million salary rows, 83 seconds) or let DuckDB generate TPC-H (600,572 order lines at scale 0.1, about 2.4 seconds). Postgres users want Pagila, which now needs PostgreSQL 18 and pgvector. For real data, IMDb's 217 million rows are for non-commercial use only. Checked 3 December 2026.

Fastero

Connect your database. Ask questions. Get dashboards.

Postgres, BigQuery, Snowflake, and 10+ sources — live-connected, AI-powered, no dashboard builder learning curve.

Try free →

Sample databases compared

What we downloaded and counted (MB is 1,048,576 bytes; rows are exact counts after loading):

Database Official engine (other ports) Download Tables Rows in biggest table
Northwind (Microsoft) SQL Server script (Postgres, SQLite ports) 1.0 MB .sql 13 2,155 order details
Sakila (MySQL) MySQL (jOOQ ports, SQLite among them) 3.2 MB .sql 16 16,049 payments
Pagila PostgreSQL 18 with pgvector 12.5 MB .sql 16 51,805 rentals
Chinook SQLite file; scripts for SQL Server, Oracle, MySQL, Postgres, Db2 1.0 MB .sqlite 11 8,715 playlist tracks
AdventureWorks2025 SQL Server, Azure SQL 47.9 MB .bak 71 121,317 order details
AdventureWorksLT2025 SQL Server; a sample option in Azure SQL Database 1.7 MB .bak 12 847 customers
WideWorldImporters Full SQL Server 2016 or later, Azure SQL 121 MB .bak, 58 MB .bacpac 48 3,654,736 sensor readings
employees (MySQL) MySQL, MariaDB, Percona; PostgreSQL 164 MB of dump files 6 2,844,047 salaries
world (MySQL) MySQL 0.4 MB .sql 3 4,079 cities
TPC-H, scale 0.1 Generated by DuckDB Nothing; a 28 MB DuckDB file 8 600,572 line items
TPC-DS, scale 0.1 Generated by DuckDB Nothing; a 36 MB DuckDB file 24 288,464 store sales
IMDb datasets Gzipped TSV files 1.9 GB, 7 files 7 103,159,954 title credits
Stack Overflow (Brent Ozar's copies) SQL Server; Postgres for the largest 1 GB to 31 GB Not loaded Not loaded

And what each is for:

Database Licence Dates in the data Good for practising
Northwind MIT (Microsoft's samples repository) 4 Jul 1996 to 6 May 1998 Joins, GROUP BY, top product per category
Sakila New BSD 24 May 2005 to 14 Feb 2006 Many-to-many joins, several join paths
Pagila PostgreSQL License Jan 2022 to Jul 2026 Time series, partitions, JSONB, vectors
Chinook MIT 2009 to 2013 Joins, a recursive CTE on the staff chart
AdventureWorks MIT 30 May 2022 to 29 Jun 2025 Schemas, big joins, hierarchyid
AdventureWorksLT MIT One day: 1 Jun 2008 A first look at SQL Server
WideWorldImporters MIT; includes data.gov and Natural Earth data 2013 to 31 May 2016 Temporal tables, JSON, a November fiscal year
employees CC BY-SA 3.0 1985 to 2002 Window functions on millions of rows, date ranges
world Not stated in the file None Joins, ROW_NUMBER per group
TPC-H, TPC-DS Data you generate 1992 to 1998; 1998 to 2003 Star schemas, the 22 and 99 benchmark queries
IMDb Personal and non-commercial use only Titles from the 1870s on Joins at 100 million rows, arrays in strings

Bar chart on a log scale of rows in each sample database's biggest table: IMDb's title.principals 103,159,954, WideWorldImporters' cold-room archive 3,654,736, MySQL employees' salaries 2,844,047, the GitHub SQLite build of Northwind 609,283, TPC-H at scale 0.1 600,572, TPC-DS at scale 0.1 288,464, AdventureWorks2025 121,317, Pagila 51,805, Sakila 16,049, Chinook 8,715, world 4,079, Microsoft's Northwind 2,155 and AdventureWorksLT2025 847

Rows in each database's biggest table, counted after loading on 3 December 2026.

Northwind database: download and load

Northwind is the order database of a small food trader, first shipped with Microsoft Access. The official copy is instnwnd.sql in Microsoft's sql-server-samples repository: 13 tables, 16 views, 7 stored procedures, 830 orders and 2,155 order lines from 4 July 1996 to 6 May 1998.

One trap: its header says "This script does not create a database." Run it as is and the tables land in master, so create the database first. In SQL Server 2025's Docker image this took 30 seconds:

docker run -d --name sqlserver -e ACCEPT_EULA=Y -p 1433:1433 \
  -e "MSSQL_SA_PASSWORD=Pick-a-Strong-Pass1" -v "$PWD:/data:ro" \
  mcr.microsoft.com/mssql/server:2025-latest
SQL="docker exec sqlserver /opt/mssql-tools18/bin/sqlcmd -S localhost -U sa -C"
$SQL -P 'Pick-a-Strong-Pass1' -Q "CREATE DATABASE Northwind"
$SQL -P 'Pick-a-Strong-Pass1' -d Northwind -i /data/instnwnd.sql

The image is 2.2 GB on disk. In Git Bash on Windows, set MSYS_NO_PATHCONV=1 first so the Linux paths survive. For Postgres, pthom's port has the same 830 orders plus a table of US states, and loaded in 8.5 seconds. We ran this in psql:

-- The best-selling product in each category, by revenue after discount.
SELECT category_name, product_name, revenue FROM (
  SELECT c.category_name, p.product_name,
         round(sum(od.unit_price * od.quantity * (1 - od.discount))::numeric) AS revenue,
         rank() OVER (PARTITION BY c.category_name
           ORDER BY sum(od.unit_price * od.quantity * (1 - od.discount)) DESC) AS rk
  FROM order_details od
  JOIN products p USING (product_id)
  JOIN categories c USING (category_id)
  GROUP BY c.category_name, p.product_name
) t
WHERE rk = 1
ORDER BY revenue DESC;
 category_name  |      product_name       | revenue
----------------+-------------------------+---------
 Beverages      | Côte de Blaye           |  141397
 Meat/Poultry   | Thüringer Rostbratwurst |   80369
 Dairy Products | Raclette Courdavault    |   71156
 Confections    | Tarte au sucre          |   47235
 Grains/Cereals | Gnocchi di nonna Alice  |   42593
 Produce        | Manjimup Dried Apples   |   41820
 Seafood        | Carnarvon Tigers        |   29172
 Condiments     | Vegie-spread            |   16701
(8 rows)

The Northwind SQLite file on GitHub is not the original data. jpwhite3's widely linked build is a 23.6 MB file with 609,283 order lines and 16,282 orders from 10 July 2012 to 28 October 2023, because its script pumps in extra rows. That suits time series, but answers from tutorials written on the 2,155-row original won't match.

Sakila database, and Pagila for PostgreSQL

Sakila is MySQL's DVD-rental store, by Mike Hillyer of the MySQL AB documentation team: 16 tables, 7 views, 1,000 films and 16,044 rentals from 24 May 2005 to 14 February 2006, under the New BSD licence. MySQL's download site refused our automated download, so we loaded the copy in MySQL's own mysql-shell repository on GitHub, in 4.4 seconds. Its point is the join paths:

-- Rental revenue by film category: five joins from payment to category.
SELECT c.name AS category, COUNT(*) AS rentals, SUM(p.amount) AS revenue
FROM payment p
JOIN rental r ON r.rental_id = p.rental_id
JOIN inventory i ON i.inventory_id = r.inventory_id
JOIN film_category fc ON fc.film_id = i.film_id
JOIN category c ON c.category_id = fc.category_id
GROUP BY c.name
ORDER BY revenue DESC
LIMIT 5;
+-----------+---------+---------+
| category  | rentals | revenue |
+-----------+---------+---------+
| Sports    |    1179 | 5314.21 |
| Sci-Fi    |    1101 | 4756.98 |
| Animation |    1166 | 4656.30 |
| Drama     |    1060 | 4587.39 |
| Comedy    |     941 | 4383.58 |
+-----------+---------+---------+

For SQLite, jOOQ's port loaded in 3.4 seconds once we wrapped its 8.5 MB of INSERTs in one transaction; without one, every row is a commit and the load was still running after two minutes.

Pagila started as the Postgres port of Sakila and has moved on. Its README says "Pagila has been tested against PostgreSQL 18 and above", and the schema needs the pgvector extension. It now holds 51,805 rentals and 51,061 payments from January 2022 to 28 July 2026, in 55 monthly partitions. The plain postgres image lacks pgvector, so we used pgvector's (657 MB); loading took 11.6 seconds:

docker run -d --name pg -e POSTGRES_PASSWORD=postgres -p 5432:5432 \
  -v "$PWD:/data:ro" pgvector/pgvector:pg18
docker exec pg createdb -U postgres pagila
docker exec -w /data pg psql -U postgres -d pagila -q -f pagila-schema.sql
docker exec -w /data pg psql -U postgres -d pagila -q -f pagila-data.sql

With 55 months of payments, Pagila is the best of these for time series. A trap we walked into: a window function runs after WHERE, so filtering to 2026 in the same query as a moving average averages January over January alone. Compute the window first:

WITH m AS (
  SELECT date_trunc('month', payment_date)::date AS month, sum(amount) AS revenue
  FROM payment GROUP BY 1
), w AS (
  SELECT month, revenue,
         round(avg(revenue) OVER (ORDER BY month ROWS 2 PRECEDING), 2) AS avg_3m
  FROM m
)
SELECT * FROM w WHERE month >= '2026-01-01' ORDER BY month;
   month    | revenue | avg_3m
------------+---------+---------
 2026-01-01 | 2255.39 | 2143.08
 2026-02-01 | 2059.00 | 2162.00
 2026-03-01 | 2366.97 | 2227.12
 2026-04-01 | 2051.04 | 2159.00
 2026-05-01 | 2380.18 | 2266.06
 2026-06-01 | 2105.73 | 2178.98
 2026-07-01 | 2409.88 | 2298.60
(7 rows)

More patterns like this are in our guide to window functions for business analytics.

Chinook database

Chinook is Luis Rocha's digital music store, an alternative to Northwind: 11 tables, 275 artists, 3,503 tracks and 412 invoices, MIT-licensed. Release 1.4.5 ships a SQLite file and a script per engine. The tracks come from a real iTunes library, and its README says "Sales information is auto generated using random data for a four year period." The invoices run from 1 January 2009 to 22 December 2013, five calendar years.

Its small staff hierarchy makes a good first recursive CTE, here in Python's built-in sqlite3:

import sqlite3
 
con = sqlite3.connect("Chinook_Sqlite.sqlite")
rows = con.execute("""
WITH RECURSIVE chain(id, name, title, depth) AS (
  SELECT EmployeeId, FirstName || ' ' || LastName, Title, 0
  FROM Employee WHERE ReportsTo IS NULL
  UNION ALL
  SELECT e.EmployeeId, e.FirstName || ' ' || e.LastName, e.Title, c.depth + 1
  FROM Employee e JOIN chain c ON e.ReportsTo = c.id
)
SELECT depth, name, title FROM chain ORDER BY depth, id
""").fetchall()
for r in rows:
    print(*r, sep=" | ")
0 | Andrew Adams | General Manager
1 | Nancy Edwards | Sales Manager
1 | Michael Mitchell | IT Manager
2 | Jane Peacock | Sales Support Agent
2 | Margaret Park | Sales Support Agent
2 | Steve Johnson | Sales Support Agent
2 | Robert King | IT Staff
2 | Laura Callahan | IT Staff

DuckDB reads the same file in place, and the sqlite3 command-line tool opens it directly (that line not run here; the tool isn't installed on this laptop):

-- DuckDB 2.0.1 (ran): rock was the top genre, $826.65 over 216 invoices
ATTACH 'Chinook_Sqlite.sqlite' AS chinook (TYPE sqlite);
-- sqlite3 CLI (not run here): sqlite3 Chinook_Sqlite.sqlite

Connect any database. Ask in plain English.

Start free →

AdventureWorks and AdventureWorksLT

AdventureWorks is Microsoft's bicycle maker, and the 2025 release is the one to get: a 47.9 MB backup that restores to 71 tables in 6 schemas, 760,167 rows and orders from 30 May 2022 to 29 June 2025. The last month is nearly empty ($47,492 of sales against $4.3 million in January 2025), so leave it out of trend charts.

Microsoft's own Linux restore example failed for us: it moves files named AdventureWorks2025 and AdventureWorks2025_log, but the backup's logical names are AdventureWorks and AdventureWorks_log. SQL Server answered (our test database's name at the end):

Msg 3234, Level 16, State 2, Server 906c28199d0d, Line 1
Logical file 'AdventureWorks2025' is not part of database 'AW_doc_test'.
Use RESTORE FILELISTONLY to list the logical file names.

List the names first, then restore:

RESTORE FILELISTONLY FROM DISK = '/data/AdventureWorks2025.bak';
RESTORE DATABASE AdventureWorks2025 FROM DISK = '/data/AdventureWorks2025.bak'
WITH MOVE 'AdventureWorks' TO '/var/opt/mssql/data/AdventureWorks2025.mdf',
     MOVE 'AdventureWorks_log' TO '/var/opt/mssql/data/AdventureWorks2025_log.ldf';

That took 0.9 seconds and left 336 MB of data files. The org chart is stored in SQL Server's hierarchyid type, so finding a manager is a method call rather than a recursive query:

SELECT TOP 5 m.JobTitle AS manager, COUNT(*) AS direct_reports
FROM HumanResources.Employee AS e
JOIN HumanResources.Employee AS m
  ON e.OrganizationNode.GetAncestor(1) = m.OrganizationNode
GROUP BY m.JobTitle
ORDER BY direct_reports DESC;
manager                                            direct_reports
-------------------------------------------------- --------------
Production Supervisor - WC40                                   26
Production Supervisor - WC50                                   26
Production Supervisor - WC60                                   26
Production Supervisor - WC30                                   25
Production Control Manager                                     22

AdventureWorksLT is, in Microsoft's words, "a lightweight and pared down version of the OLTP sample": 12 tables, 4,277 rows and 32 orders, all dated 1 June 2008. It's the sample Azure SQL Database offers when you create a database, the quickest SQL Server sample to reach from a cloud tool. A data-warehouse version, AdventureWorksDW, also exists; we didn't load it.

WideWorldImporters sample database

WideWorldImporters is the wholesaler Microsoft published in June 2016 for SQL Server 2016, with temporal tables, JSON, memory-optimized and columnstore tables, sensor data from cold rooms and vans, and a financial year starting 1 November. Microsoft says the released databases "have data from January 1, 2013, up to the day that the databases were generated."

We didn't restore it: the Full backup is 121 MB, but RESTORE FILELISTONLY shows files of 1 GB, 2 GB and 100 MB, over 3 GB of disk. Instead we read Microsoft's .bacpac export, a zip file, in Python: 48 tables and 4,713,833 rows, by its own export statistics. Its biggest table, the cold-room temperature archive, stores fixed 56-byte records, so we counted it exactly: 3,654,736 readings from 20 December 2015 to 31 May 2016. The Full version needs SQL Server's Evaluation, Developer or Enterprise edition; the Standard files suit the others and Azure SQL.

MySQL employees database

The employees database is fabricated HR data from Siemens Corporate Research, given a relational schema by Giuseppe Maxia, under CC BY-SA 3.0: 6 tables, 300,024 employees, 2,844,047 salary rows and 3,919,015 rows in all, hired from 1985 to 2000. Its README warns "The data was generated, and as such there are inconsistencies and subtle problems", and offers them as cleaning exercises. Loading the 164 MB of dumps took 82.5 seconds, and the repository's checksum test passed for all six tables:

# in the test_db folder, from github.com/datacharmer/test_db
docker run -d --name mysql -e MYSQL_ROOT_PASSWORD=pass -v "$PWD:/data:ro" mysql:8.4
docker exec -w /data mysql mysql -uroot -ppass -e "source employees.sql"
docker exec -w /data mysql mysql -uroot -ppass -t -e "source test_employees_md5.sql"

From MySQL 9.5 the client needs --commands for source, the README notes. Salaries have from and to dates, with 9999-01-01 marking the current row, the shape of most slowly changing data. Ranking departments by current pay with RANK() scans all 2.8 million salary rows in 3.7 seconds: Sales first at $88,853 across 37,701 people, then Marketing and Finance.

The world database

MySQL's world database has 239 countries, 4,079 cities and 984 country-language rows in three tables, and no dates, so it's for joins and grouping. We used the copy in the mysql-shell repository, an old dump with one INSERT per row that took 43 seconds. The largest city per continent is a classic ROW_NUMBER() exercise: Mumbai (Bombay) at 10,500,000 for Asia, São Paulo for South America, Sydney for Oceania.

TPC-H and TPC-DS: sample data at any scale

TPC-H is the benchmark schema of orders, line items, customers, parts and suppliers; TPC-DS is its bigger retail cousin. DuckDB generates either in one statement, here in Python with DuckDB 2.0.1:

import duckdb
 
con = duckdb.connect()
con.execute("CALL dbgen(sf = 0.1)")  # TPC-DS: CALL dsdgen(sf = 0.1)
con.sql("""
SELECT year(o_orderdate) AS year,
       round(sum(l_extendedprice * (1 - l_discount)) / 1e6, 1) AS revenue_m,
       round(100 * (revenue_m / lag(revenue_m) OVER (ORDER BY year) - 1), 1) AS pct
FROM orders JOIN lineitem ON l_orderkey = o_orderkey
GROUP BY year ORDER BY year
""").show()
┌───────┬───────────┬────────┐
│ year  │ revenue_m │  pct   │
│ int64 │  double   │ double │
├───────┼───────────┼────────┤
│  1992 │    3124.6 │   NULL │
│  1993 │    3063.8 │   -1.9 │
│  1994 │    3150.7 │    2.8 │
│  1995 │    3144.2 │   -0.2 │
│  1996 │    3103.8 │   -1.3 │
│  1997 │    3088.6 │   -0.5 │
│  1998 │    1859.3 │  -39.8 │
└───────┴───────────┴────────┘

Scale 0.1 made 8 tables and 866,602 rows; over nine runs it took 1.1 to 3.1 seconds, median 2.4, on a laptop shared with other work. Scale 1 (6,001,215 line items) took 2.6 seconds, and TPC-DS at 0.1 (24 tables, 1,176,170 rows) a median of 4.5. The flat years and the 1998 drop are the generator's: orders are spread evenly and stop on 2 August 1998, so this data teaches syntax, not trends. DuckDB's docs warn of "small differences from the official TPC-H specification"; our free datasets guide has scale 1's memory use.

Timeline of the dates in each sample database: the GitHub SQLite build of Northwind 2012 to 2023, Pagila 2022 to 2026, AdventureWorks2025 2022 to 2025, WideWorldImporters 2013 to 2016, Chinook 2009 to 2013, AdventureWorksLT a single day in 2008, Sakila 10 months in 2005 and 2006, TPC-DS 1998 to 2003, Microsoft's Northwind 23 months from 1996 to 1998, TPC-H 1992 to 1998 and MySQL employees' salary start dates 1985 to 2002

First and last date in each database's main table, as loaded on 3 December 2026.

Large real-world databases: IMDb and Stack Overflow

IMDb publishes seven gzipped TSV files, refreshed daily: 1.9 GB compressed and 217,680,084 rows when we streamed them, from 1.7 million ratings to 103,159,954 rows of who worked on what. The terms are strict: "Subsets of IMDb data are available for access to customers for personal and non-commercial use." DuckDB queries the files without unpacking them:

SELECT b.primaryTitle AS title, b.startYear AS year, r.averageRating AS rating,
       r.numVotes::INT AS votes
FROM read_csv('title.ratings.tsv.gz', delim='\t', quote='', header=true,
              nullstr='\N', all_varchar=true) r
JOIN read_csv('title.basics.tsv.gz', delim='\t', quote='', header=true,
              nullstr='\N', all_varchar=true) b USING (tconst)
WHERE b.titleType = 'movie' AND r.numVotes::INT >= 1000000
ORDER BY r.averageRating::DOUBLE DESC, votes DESC
LIMIT 5;
┌───────────────────────────────────────────────┬─────────┬─────────┬─────────┐
│                     title                     │  year   │ rating  │  votes  │
│                    varchar                    │ varchar │ varchar │  int32  │
├───────────────────────────────────────────────┼─────────┼─────────┼─────────┤
│ The Shawshank Redemption                      │ 1994    │ 9.3     │ 3270436 │
│ The Godfather                                 │ 1972    │ 9.2     │ 2275826 │
│ The Dark Knight                               │ 2008    │ 9.1     │ 3255896 │
│ The Lord of the Rings: The Return of the King │ 2003    │ 9.0     │ 2211407 │
│ Schindler's List                              │ 1993    │ 9.0     │ 1615737 │
└───────────────────────────────────────────────┴─────────┴─────────┴─────────┘

Start years run from 1874 to 2115, with 7,741 titles dated after 2026, so filter announced titles before you chart by year. The query took 5.7 seconds on the downloaded files.

Stack Overflow is the real-world database Brent Ozar teaches SQL Server tuning on. He repackages the public data dump under CC BY-SA 4.0: StackOverflow2010 is a 1 GB download that "Expands to a ~10GB database called StackOverflow2010 with data from the years 2008 to 2010", the 2013 copy is 10 GB that restores to 50 GB, and the 2024 copy is a 31 GB torrent that becomes 202 GB, also offered for Postgres. All are past our 1 GB disk limit, so we didn't load them. Since July 2024 the official dump is downloaded from your Stack Exchange profile, after accepting terms that exclude training a large language model, the ArchiveTeam wiki records.

Where Fastero fits

For practice on your own machine, the tools above are the right ones. Fastero is an AI and data platform where people and AI agents work together on a team's data, in the browser. Every new account comes with an invented sample: a sales table of made-up orders you can query in the SQL editor straight away, in DuckDB SQL, with a sample dashboard, notebook and Streamlit app built on it.

To use one of the databases above in Fastero, put it where Fastero can reach it:

  • Load it into a Postgres, MySQL or SQL Server you host, such as a free Neon or Supabase Postgres (our free Postgres guide compares the limits), then save the connection and query it in the SQL editor, chart it or ask the AI chat. Northwind's Postgres database took 8.5 MB and Pagila's 36 MB, small for any free Postgres tier; Pagila also needs the pgvector extension, so check your host offers it.
  • Export tables to CSV and upload them to a project, up to 100 MB a file within your plan's storage (500 MB on Free), and query them with SQL.

Fastero runs in the cloud, so the database must be reachable from the internet or through an SSH tunnel; one that only listens on your laptop, like the containers above, isn't. Fastero doesn't host databases, and SQLite files and .bak backups can't be uploaded as databases: restore the backup into a SQL Server you run, or open the SQLite file in DuckDB and export CSVs. The Free plan has no end date and needs no card (pricing).

Fastero's SQL editor with a saved query on a connection, a FILTER-per-channel GROUP BY over twelve months, and the 12-row result table under it

Fastero's SQL editor on a saved connection, in a demo workspace with invented marketing data.

FAQ

What is the best sample database for SQL practice?

For beginners, Chinook or Northwind: about a dozen tables a reader can hold in their head. For window functions and performance, the MySQL employees database with 2.8 million salary rows, or TPC-H, which DuckDB generates at any size. For a realistic company schema, AdventureWorks2025 on SQL Server.

Where can I download the Northwind database?

Microsoft publishes instnwnd.sql in its sql-server-samples repository on GitHub, for SQL Server. pthom's northwind_psql repository has a Postgres port with the same 830 orders. The popular SQLite build by jpwhite3 has 609,283 order lines from 2012 to 2023, not the original 2,155.

Is AdventureWorks free?

Yes. Microsoft publishes the backups on GitHub under the MIT licence, from AdventureWorks2008R2 to AdventureWorks2025, in OLTP, data-warehouse and lightweight versions. Restoring one needs SQL Server, whose Docker image runs the Developer edition by default, or Azure SQL Database, which can create AdventureWorksLT as a sample.

Is there a sample database for PostgreSQL?

Pagila, the Postgres port of Sakila, is the usual one; it now needs PostgreSQL 18 and the pgvector extension. Chinook and the MySQL employees database also ship Postgres scripts, and pthom's repository ports Northwind.

What is the Sakila database?

MySQL's sample DVD-rental store: 16 tables, 1,000 films and 16,044 rentals from May 2005 to February 2006, under the New BSD licence. It's built for practising joins, with several paths between films, stores, customers and payments.

How do I get a large sample database?

Generate one: DuckDB's CALL dbgen(sf = 10) should make TPC-H with about 60 million line items, ten times the 6 million we counted at scale 1 (we didn't run scale 10). For real data, IMDb's files hold 103 million rows in their biggest table, for non-commercial use, and Brent Ozar's Stack Overflow databases run from 1.5 GB to 202 GB.

Sources

Read and downloaded on 3 December 2026:


Try Fastero free: query the sample sales table in your browser, then connect the database you practised on. No credit card required.

Ready to try it yourself?

Connect your database, ask questions in plain English, and get live dashboards — in under 2 minutes. No credit card required.

Follow Fastero on LinkedIn for new articles and examples.

Keep reading

Related articles

2026-12-03

SQL Interview Questions: 34 With Answers Tested in DuckDB and PostgreSQL, Easy to Hard (2026)

34 SQL interview questions for data analyst, analytics engineer and data scientist roles, from GROUP BY to gaps and islands, each with SQL we ran in DuckDB 2.0.1 and PostgreSQL 16 and its real output. NOT IN returned 0 rows where NOT EXISTS returned 5, and on 40,000 rows a correlated subquery took 171 seconds in PostgreSQL against 27 ms for a window function.

sqlsql-interviewwindow-functions

2026-12-03

Sample CSV File Download: 9 Free Test Files, 100 to 10,000 Rows, 15 Edge Cases Tested (2026)

Nine free sample CSV files of invented data: orders with 100, 1,000 and 10,000 rows, 1,000 customers, 731 days of metrics, and four test files with quoted commas, line breaks, NULL markers, leading zeros, big integers, a BOM, semicolons and broken rows. We read each with pandas 3.1.2, DuckDB 2.0.1, Python's csv module and PostgreSQL 16 COPY: pandas changed 6 of 15 edge cases without an error, DuckDB 1.

csvsample-datapandas

2026-12-02

Online SQL Compiler: 12 Free Ones Compared by Engine, Plus 10 Practice Exercises With Answers (2026)

Twelve free online SQL compilers, editors and fiddles compared on 2 December 2026 by the engines and versions they run, sample data, share links and accounts. db<>fiddle runs the most, from SQL Server 2025 to Oracle 26ai. Then ten practice exercises with real answers, the dialect differences we hit in SQLite, DuckDB and PostgreSQL, and a timed test: a GROUP BY on 1 million rows took 1.8 s in sql.js in the browser and 21 ms in native DuckDB.

sqlsql-practiceduckdb