Skip to content
Data elsewhere

Free SQL Sample Databases and Public Datasets

16 places to get free data to practice SQL on, none of which are ours. The datasets on this site are built for teaching: most are small enough to check by eye, and the largest runs to 426,024 rows. Once you want something messier, or on a subject you actually care about, these are the ones worth knowing.

Everything listed is free to access without payment. None of it is ours, and none of it is covered by the CC0 1.0 dedication on SQLShed's own datasets. Licenses differ from source to source, and several of these are not public domain, so check the terms where the data lives before you republish anything.

Classic SQL sample databases

These ship as SQL dump files: CREATE TABLE and INSERT statements you load into a database you control. They are the schemas most SQL tutorials, books, and job interviews quietly assume you have seen. You cannot upload a dump to the playground on this site; point your own PostgreSQL, MySQL, or SQLite instance at these instead.

Postgres · MySQL · SQLite · SQL Server

Chinook

A digital music store: artists, albums, tracks, invoices, employees, and customers across 11 tables.

The best all-round starter. Deep enough for four-table joins from invoice line back to artist, small enough to hold in your head, and it ships ready-made for every major engine.

MySQL

Sakila

MySQL's own DVD rental sample database: films, actors, stores, staff, rentals, and payments.

The many-to-many between films and actors is the classic teaching case for join fan-out, and the rental and payment tables give you real date arithmetic to practice on. On Postgres, use Pagila below.

Postgres

Pagila

A PostgreSQL port of Sakila, rebuilt with Postgres types, partitioned tables, and full-text search columns.

Use this over Sakila if you are on Postgres. The partitioned payment table is a rare chance to practice against something closer to a production schema.

Postgres

Northwind

The Microsoft Access era trading-company schema: orders, order details, products, suppliers, shippers, and employees.

Small, tidy, and still the example used in a huge amount of older SQL writing, so it is worth recognizing. The employee reports-to column is a ready-made self-join exercise.

SQL Server

AdventureWorks

Microsoft's full bicycle-manufacturer sample: sales, purchasing, production, and HR across roughly 70 tables.

The one on this list that is genuinely large. Worth reaching for when you want to practice finding your way around an unfamiliar schema rather than querying a known one.

MySQL

MySQL employees

Around four million rows of synthetic HR data: employees, salaries, titles, and department history.

The volume is the point. Aggregates and joins that feel instant on a few thousand rows start to have a cost here, which makes it a good place to see what an index does.

Open data portals

Real published data, mostly as CSV or Parquet. This is messier than any teaching schema (inconsistent codes, missing values, columns that changed meaning between years), which is exactly why it is worth practicing on. Anything here under 10 MB can go straight into the SQLShed playground.

CSV · JSON · API

Data.gov

The US federal open-data catalog: several hundred thousand datasets from agencies across government.

Enormous range, variable quality. Good for finding a subject you actually care about, which matters more for sticking with practice than any schema does.

CSV

Our World in Data

Cleaned, documented, long-format datasets on health, energy, climate, population, and economics.

Unusually tidy for public data, and almost everything is entity-year shaped. That makes it close to ideal for practicing window functions: running totals, year-over-year change, and rank within a year.

CSV · API

World Bank Open Data

Development indicators for every country, most series running back to 1960.

Wide sparse tables with a lot of legitimately missing values, so it is a realistic place to learn what NULL does to an AVG and why COALESCE is not always the answer.

Parquet

NYC TLC trip records

Every recorded taxi and for-hire trip in New York City, by month, as Parquet.

The standard large public dataset for analytics work. DuckDB reads Parquet natively. A green-taxi month (about 1.4 MB) fits under the playground's 10 MB upload limit; a yellow-taxi month is about 50 MB and millions of rows, so open that one in DuckDB on your own machine. Either way you get timestamps, locations, and money to group.

Search

Google Dataset Search

A search engine over dataset metadata published across thousands of repositories and government sites.

Not a dataset itself. Use it when you know the question you want to answer and need to find data that fits, rather than browsing a catalog and hoping.

Index

Awesome Public Datasets

A long-running community-maintained index of public datasets, grouped by subject.

The fastest way to find data in a specific field (sports, biology, transport, finance) without wading through a general-purpose catalog.

Free places to run SQL

Other free sites that give you a query editor and something to query. All four run in the browser with no signup, and each is good at something different from the others.

In-browser

SQLZoo

A long-running set of graded SQL exercises built around world geography, football, and film data.

The tutorial that a lot of people learned on. Its later JOIN and self-join sections are genuinely hard and still worth working through.

In-browser · Postgres

PostgreSQL Exercises

Around eighty exercises against a fictional country club's members, bookings, and facilities.

The most rigorous free set for Postgres specifically, and one of the few that seriously covers recursive CTEs and window functions with worked answers.

In-browser · SQLite

SQL Murder Mystery

A single puzzle: solve a fictional crime by querying a police database of interviews, licenses, and reports.

The best thing on this list for someone who knows the syntax but freezes when asked to find something out. You are given no query plan, only a question.

Multi-engine

DB Fiddle

A scratch pad for running SQL against a chosen version of PostgreSQL, MySQL, MariaDB, or SQLite.

Not for practice so much as for settling arguments. Paste a schema, pick two engines, and see exactly where their behavior diverges before you post the question anywhere.

Querying a downloaded file here

The playground on this site reads CSV and Parquet files directly. Open it, use Upload CSV / Parquet, and pick a file up to 10 MB. It becomes a table you can join against, named after the file, and it is read locally in your browser rather than uploaded to a SQLShed server. That covers most of the open data portals above.

It does not cover the sample databases in the first section. Those are SQL dump files full of CREATE TABLE and INSERT statements, which need a real database to run against rather than a file reader. Install PostgreSQL, MySQL, or SQLite locally for those, or use DB Fiddle if you only want to poke at one for a few minutes.